Author Topic: Create a new DID Group & Resource Groups using Platform SDK  (Read 5903 times)

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 52
  • Karma: 0
Create a new DID Group & Resource Groups using Platform SDK
« on: August 25, 2018, 01:44:03 AM »
Hi Experts,

I am trying to create a new DID Group & Resource group using Platform SDK but i am not able to find the class through which i could create them.
Could you please help me with the class name or any pointer?

Offline jamesmurphyau

  • Full Member
  • ***
  • Posts: 123
  • Karma: 2
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #1 on: August 25, 2018, 10:37:11 AM »
These are not their own objects.. they are options co figured in the annex of other objects. DID groups (if I recall) are configured on the Tenang object. Resource groups are configured either on the annex of an application folder, or by specifying the option in the connection tab (connection tab of RM, connecting to MCP)..

The best bet is to create these objects in GA or GAX and review the objects (the Tenant and the Application Folder objects)

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 52
  • Karma: 0
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #2 on: August 28, 2018, 10:11:49 PM »
Hi jamesmurphyau,

Thanks for your advise. It did help me getting the code set for DIDGroup but for Resource Group, i need to create a folder under which i will add Applcation objectID. But i am getting the error:- No persmissions to create an object under this folder.

Here is the the code for DID Group which is working:-

CfgTenantQuery ctq = new CfgTenantQuery();
      ctq.setDbid(1);
      CfgTenant ct = confService.retrieveObject(CfgTenant.class, ctq);
      KeyValueCollection kvc = ct.getUserProperties();
      if (kvc != null)
      {
         if (kvc.containsKey("gvp.dn-groups"))
         {
            KeyValueCollection kvc1 = kvc.getList("gvp.dn-groups");
            
            kvc1.addString("demo_test", "");
            System.out.println("Success");
            
         }
         
         
      }
      ct.save();

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
  • Karma: 56330
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #3 on: August 28, 2018, 10:17:24 PM »
So,...check permissions for the user you are using
Check CfgServer logs

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 52
  • Karma: 0
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #4 on: October 02, 2018, 03:32:17 PM »
Sorry cavagnaro for the late reply as i was on long leave.
The thing is as we create a Resource group , CME automatically creates a folder with name "GVP_name we give_LRG" at the root level. I am finding it difficult to code for this automatic folder creation.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
  • Karma: 56330
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #5 on: October 02, 2018, 09:03:21 PM »
Why would you do that? Just curious. Seems you wanna replace GA? How often does one need to deploy a MCP into an existing environment?

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 52
  • Karma: 0
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #6 on: October 03, 2018, 04:34:24 PM »
Hey Cavagnaro,

this is the requirement given to us by our client which is to check whether we are able to get each and every configuration of CME through Platform SDK.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2739
  • Karma: 44
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #7 on: October 03, 2018, 05:05:08 PM »
LRGP is just a CfgFolder type, so you have to create folder and configure options related to the LRGP configuration.
Genesys certified professional consultant (GVP, SIP, GIR and Troubleshooting)

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 52
  • Karma: 0
Re: Create a new DID Group & Resource Groups using Platform SDK
« Reply #8 on: November 21, 2018, 09:21:41 PM »
Hi All,

Here is the code to make a folder at Tenant level:-

CfgTenantQuery ctq = new CfgTenantQuery();
      ctq.setDbid(1);
      
      CfgTenant cfgFolderParent = ctq.executeSingleResult();
      folderId = cfgFolderParent.getDBID();
      
      ownerId = new CfgOwnerID(confService,null);
      ownerId.setDBID(cfgFolderParent.getDBID());
        ownerId.setType(cfgFolderParent.getObjectType());
       
        CfgFolder folder = new CfgFolder(confService);
        folder.setName("test");
        folder.setOwnerID(ownerId);
        folder.setType(CfgObjectType.CFGFolder);
        folder.setFolderClass(CfgFolderClass.CFGFCDefault);
        folder.setCustomType(0);
        folder.save();