Environment

environment.Group

Estimated reading: 7 minutes 605 views
Namespace: Environment
REST: https://[hoster-api-host]/1.0/environment/group/rest/{method-name}
Scripting: environment.group.{method-name}
Categorize environments in the account with the help of the group management API. Such user-defined groups can filter the environment list, allowing a clear-cut view of the projects. Learn more in the documentation.

Methods

AttachEnv (envName, session, envGroup, [targetAppid], [ownerUid] ) :

Adds environment to a group.

URL

https://[hoster-api-host]/1.0/environment/group/rest/attachenv

Parameters

  • envName : “string”

    target environment name.

  • session : “string”
  • envGroup : “string”

    a comma-separated list of the target environment group names.

  • targetAppid : “string” (optional)

    if specified, redefines the target environment. For example, to the environment shared via the collaboration feature.

  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/attachenv?envName=[string]&session=[string]&envGroup=[string]&targetAppid=[string]&ownerUid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

CreateGroup (envName, session, [envGroup], [data], [ownerUid] ) :

Creates a new environment group.

URL

https://[hoster-api-host]/1.0/environment/group/rest/creategroup

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • envGroup : “string” (optional)

    a comma-separated list of the target environment group names.

  • data : “json” (optional)

    JSON object with the new group settings:

    {
       "color": "string",
       "environments": [
          "AppNodes",
          "..."
       ],
       "hierarchy": "string",
       "icon": "string",
       "id": "int",
       "isIsolated": "boolean",
       "name": "string",
       "parent": "EnvironmentGroup",
       "uid": "int",
       "visibility": "SHOW(0) | HIDE(1) | SHOW_IF_NOT_EMPTY(2)"
    }
  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/creategroup?data=[json]&envName=[string]&session=[string]&envGroup=[string]&ownerUid=[int]

Response

  • ArrayResponse
    {
       "array": [
          {
             "color": "string",
             "hierarchy": "string",
             "icon": "string",
             "isIsolated": "boolean",
             "name": "string",
             "uid": "int",
             "visibility": "SHOW(0) | HIDE(1) | SHOW_IF_NOT_EMPTY(2)"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

DetachEnv (envName, session, envGroup, [targetAppid], [ownerUid] ) :

Excludes environment from the group.

URL

https://[hoster-api-host]/1.0/environment/group/rest/detachenv

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • envGroup : “string”

    a comma-separated list of the target environment group names.

  • targetAppid : “string” (optional)

    if specified, redefines the target environment. For example, to the environment shared via the collaboration feature.

  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/detachenv?envName=[string]&session=[string]&envGroup=[string]&targetAppid=[string]&ownerUid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

EditGroup (envName, session, srcGroupName, [dstGroupName], [data], [ownerUid] ) :

Adjusts the existing environment group.

URL

https://[hoster-api-host]/1.0/environment/group/rest/editgroup

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • srcGroupName : “string”

    target environment group name.

  • dstGroupName : “string” (optional)

    New environment group name (renames srcGroupName).

  • data : “json” (optional)

    JSON object with the updated group settings:

    {
       "color": "string",
       "environments": [
          "AppNodes",
          "..."
       ],
       "hierarchy": "string",
       "icon": "string",
       "id": "int",
       "isIsolated": "boolean",
       "name": "string",
       "parent": "EnvironmentGroup",
       "uid": "int",
       "visibility": "SHOW(0) | HIDE(1) | SHOW_IF_NOT_EMPTY(2)"
    }
  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/editgroup?srcGroupName=[string]&data=[json]&envName=[string]&session=[string]&dstGroupName=[string]&ownerUid=[int]

Response

  • ArrayResponse
    {
       "array": [
          {
             "color": "string",
             "hierarchy": "string",
             "icon": "string",
             "isIsolated": "boolean",
             "name": "string",
             "uid": "int",
             "visibility": "SHOW(0) | HIDE(1) | SHOW_IF_NOT_EMPTY(2)"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

GetGroups (envName, session, [targetAppid], [ownerUid] ) :

Returns a list of groups for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/group/rest/getgroups

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • targetAppid : “string” (optional)

    if specified, redefines the target environment. For example, to the environment shared via the collaboration feature.

  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/getgroups?envName=[string]&session=[string]&targetAppid=[string]&ownerUid=[int]

Response

  • ArrayResponse
    {
       "array": [
          {
             "color": "string",
             "hierarchy": "string",
             "icon": "string",
             "isIsolated": "boolean",
             "name": "string",
             "uid": "int",
             "visibility": "SHOW(0) | HIDE(1) | SHOW_IF_NOT_EMPTY(2)"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

RemoveGroup (envName, session, envGroup, [ownerUid] ) :

Removes specified environment group.

URL

https://[hoster-api-host]/1.0/environment/group/rest/removegroup

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • envGroup : “string”

    a comma-separated list of the target environment group names.

  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/removegroup?envName=[string]&session=[string]&envGroup=[string]&ownerUid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

SetEnv (envName, session, envGroup, [targetAppid] ) :

Replaces environment’s current group list with a new one.

URL

https://[hoster-api-host]/1.0/environment/group/rest/setenv

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • envGroup : “string”

    a comma-separated list of the target environment group names.

  • targetAppid : “string” (optional)

    if specified, redefines the target environment. For example, to the environment shared via the collaboration feature.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/setenv?envName=[string]&session=[string]&envGroup=[string]&targetAppid=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "color": "string",
             "hierarchy": "string",
             "icon": "string",
             "isIsolated": "boolean",
             "name": "string",
             "uid": "int",
             "visibility": "SHOW(0) | HIDE(1) | SHOW_IF_NOT_EMPTY(2)"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

SetIsolationEnabled (envName, session, groupName, enabled, [ownerUid] ) :

Enables or disables isolation for the specified environment group. Learn more in the documentation.

URL

https://[hoster-api-host]/1.0/environment/group/rest/setisolationenabled

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • groupName : “string”

    target environment group name.

  • enabled : “boolean”

    defines whether isolate (true) or not (false) environments within the group.

  • ownerUid : “int” (optional)

    unique identifier of the target account’s owner. Required if the operation is performed by the collaboration member on the shared account.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/group/rest/setisolationenabled?groupName=[string]&envName=[string]&session=[string]&ownerUid=[int]&enabled=[boolean]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Leave a Comment