All Products
Search
Document Center

Resource Orchestration Service:GetStackGroup

Last Updated:Sep 12, 2024

In this example, the information about a stack group named \\`MyStackGroup\\` is queried. The stack group is granted self-managed permissions and created in the China (Hangzhou) region.

Operation description

For more information about common request parameters, see Common parameters.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ros:GetStackGroupget
  • StackGroup
    acs:ros:{#regionId}:{#accountId}:stackgroup/{#StackGroupName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The name of the stack group. The name must be unique within a region.

The name can be up to 255 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

Note You must specify one of the StackGroupName and StackGroupId parameters.
cn-hangzhou
StackGroupNamestringNo

The ID of the stack group.

Note You must specify one of the StackGroupName and StackGroupId parameters.
MyStackGroup
StackGroupIdstringNo

The ID of the request.

fd0ddef9-9540-4b42-a464-94f77835****
Error codeError messageHTTP status codeDescription
StackGroupNotFoundThe StackGroup ({name}) could not be found.404The error message returned because the specified stack group does not exist. name indicates the name of the stack group.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The details of the stack group.

14A07460-EBE7-47CA-9757-12CC4761D47A
StackGroupobject

Details of the stack group.

StackGroupIdstring

The status of the stack group.

Valid values:

  • ACTIVE
  • DELETED
fd0ddef9-9540-4b42-a464-94f77835****
Statusstring

The name of the RAM role that is specified for the administrator account in Resource Orchestration Service (ROS) when you create the self-managed stack group. If this parameter is not specified, the default value AliyunROSStackGroupAdministrationRole is returned.

ACTIVE
AdministrationRoleNamestring

The parameters of the stack group.

AliyunROSStackGroupAdministrationRole
Parametersarray<object>

The key of the parameter.

object
ParameterKeystring

The name of the parameter.

Amount
ParameterValuestring

The value of the parameter.

12
Descriptionstring

The name of the stack group.

StackGroup Description
StackGroupNamestring

The name of the RAM role that is specified for the execution account when you create the self-managed stack group. The administrator role AliyunROSStackGroupAdministrationRole assumes the execution role. If this parameter is not specified, the default value AliyunROSStackGroupExecutionRole is returned.

MyStackGroup
ExecutionRoleNamestring

The template body.

AliyunROSStackGroupExecutionRole
TemplateBodystring

The structure that contains the template body.

Note We recommend that you use TemplateContent instead of TemplateBody.
{"ROSTemplateFormatVersion": "2015-09-01"}
StackGroupDriftDetectionDetailobject

The time when drift detection was performed on the stack group.

DriftDetectionTimestring

The number of stack instances.

2020-02-27T07:47:47
TotalStackInstancesCountinteger

The number of stack instances that failed drift detection.

2
FailedStackInstancesCountinteger

The status of drift detection on the stack group.

Valid values:

  • COMPLETED: Drift detection is performed and completed on all stack instances.
  • FAILED: Drift detection is performed. The number of stack instances that failed the drift detection exceeds the specified threshold.
  • PARTIAL_SUCCESS: Drift detection is performed. The number of stack instances that failed the drift detection does not exceed the specified threshold.
  • IN_PROGRESS: Drift detection is being performed on the stack group.
  • STOPPED: Drift detection is canceled for the stack group.
0
DriftDetectionStatusstring

The drift status of the stack group.

Valid values:

  • DRIFTED: At least one stack instance in the stack group has drifted.
  • NOT_CHECKED: No drift detection is completed on the stack group.
  • IN_SYNC: All the stack instances in the stack group are being synchronized.
COMPLETED
StackGroupDriftStatusstring

The number of stack instances on which drift detection was being performed.

DRIFTED
InProgressStackInstancesCountinteger

The number of stack instances that were being synchronized.

0
InSyncStackInstancesCountinteger

The number of stack instances for which drift detection was canceled.

1
CancelledStackInstancesCountinteger

The number of stack instances that have drifted.

0
DriftedStackInstancesCountinteger

The ID of the resource group. This parameter is specified when you create the stack group.

1
ResourceGroupIdstring

The permission model.

Valid values:

  • SELF_MANAGED: the self-managed permission model
  • SERVICE_MANAGED: the service-managed permission model
Note For more information about the permission models of stack groups, see Overview .
rg-acfmxazb4ph6aiy****
PermissionModelstring

The information about automatic deployment settings.

Note This parameter is returned only when the PermissionModel parameter is set to SERVICE_MANAGED.
SELF_MANAGED
AutoDeploymentobject

Indicates whether automatic deployment is enabled.

Valid values:

  • true: Automatic deployment is enabled. If a member account is added to the folder to which the stack group belongs after automatic deployment is enabled, the stack group deploys its stack instances in the specified region where the added account is deployed. If the account is deleted from the folder, the stack instances in the specified region are deleted from the stack group.
  • false: Automatic deployment is disabled. After automatic deployment is disabled, the stack instances remain unchanged when the member account in the folder is changed.
Enabledboolean

Indicates whether stacks in the member account are retained when the member account is deleted from the folder.

Valid values:

  • true: The stacks are retained.
  • false: The stacks are deleted.
Note This parameter is returned only when the Enabled parameter is set to true.
true
RetainStacksOnAccountRemovalboolean

The folder IDs of the resource directory. This parameter is used to deploy stack instances within all the accounts in the folders.

Note This parameter is returned only when the PermissionModel parameter is set to SERVICE_MANAGED.
true
RdFolderIdsarray

The folder IDs of the resource directory. This parameter is used to deploy stack instances within all the accounts in the folders.

Note This parameter is returned only when the PermissionModel parameter is set to SERVICE_MANAGED.
string

The folder IDs of the resource directory. This parameter is used to deploy stack instances within all the accounts in the folders.

Note This parameter is returned only when the PermissionModel parameter is set to SERVICE_MANAGED.
["fd-4PvlVLOL8v"]
TemplateContentstring

The JSON-formatted structure that contains the template body. For more information, see Template syntax.

{ "ROSTemplateFormatVersion": "2015-09-01" }

The operation that you want to perform. Set the value to GetStackGroup.

Examples

Sample success responses

JSONformat

{
  "RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "StackGroup": {
    "StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
    "Status": "ACTIVE",
    "AdministrationRoleName": "AliyunROSStackGroupAdministrationRole",
    "Parameters": [
      {
        "ParameterKey": "Amount",
        "ParameterValue": "12"
      }
    ],
    "Description": "StackGroup Description",
    "StackGroupName": "MyStackGroup",
    "ExecutionRoleName": "AliyunROSStackGroupExecutionRole",
    "TemplateBody": "{\"ROSTemplateFormatVersion\": \"2015-09-01\"}",
    "StackGroupDriftDetectionDetail": {
      "DriftDetectionTime": "2020-02-27T07:47:47",
      "TotalStackInstancesCount": 2,
      "FailedStackInstancesCount": 0,
      "DriftDetectionStatus": "COMPLETED",
      "StackGroupDriftStatus": "DRIFTED",
      "InProgressStackInstancesCount": 0,
      "InSyncStackInstancesCount": 1,
      "CancelledStackInstancesCount": 0,
      "DriftedStackInstancesCount": 1
    },
    "ResourceGroupId": "rg-acfmxazb4ph6aiy****",
    "PermissionModel": "SELF_MANAGED",
    "AutoDeployment": {
      "Enabled": true,
      "RetainStacksOnAccountRemoval": true
    },
    "RdFolderIds": [
      "[\"fd-4PvlVLOL8v\"]"
    ],
    "TemplateContent": "{\n      \"ROSTemplateFormatVersion\": \"2015-09-01\"\n}"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-10The response structure of the API has changedView Change Details
2023-05-10The response structure of the API has changedView Change Details