appdata.createNameSpace - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

gigagenie.appdata.createNameSpace

API 설명

  • 데이터네임스페이스 생성 API
  • 특정 이름의 데이터네임스페이스를 생성한다.

API 구조

  • function createNameSpace(options,callback)
  • options
    • namespace: (String, Mandatory) Namespace명
    • shareflag: (String, Mandatory) Namespace 공유 여부 설정(이용가이드 v1.0 에서는 N만 지원)
      • N: App 전용 데이터 생성
  • result_cd
    • 200: 성공
    • 409: 이미 존재하는 namespace
    • 500: 시스템 Error
  • extra
    • null

사용 예시

// callback 방식
var options = {};
options.namespace = 'userappprofile';
options.shareflag = 'N';
gigagenie.appdata.createNameSpace(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log("Namespace creation is success.");
    } else {
        console.log("Namespace creation is fail.");
    }
});

// promise 방식
var options = {};
options.namespace = 'userappprofile';
options.shareflag = 'N';
gigagenie.appdata.createNameSpace(options).then(function (extra) {
    console.log("Namespace creation is success.");
}).catch(function (result_cd, result_msg, extra) {
    console.log("Namespace creation is fail.");
})

활용 예제는 GiGA Genie 2048에서 확인 가능합니다