Queries the activation status and the RAM roles of an Alibaba Cloud service.
Description
This topic describes how to query the activation status and the RAM roles of an Alibaba Cloud service. In this example, the Elastic High Performance Computing (E-HPC) service that is deployed in the China (Hangzhou) region is queried.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetServiceProvisions |
The operation that you want to perform. Set the value to GetServiceProvisions. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region. You can call the DescribeRegions operation to query the most recent region list. |
TemplateBody | String | No | {"ROSTemplateFormatVersion": "2015-09-01","Resources": {"ApiGateway": {"Type": "ALIYUN::ApiGateway::Group","Properties": { "GroupName": "ros_example" }},"FC": {"Type": "ALIYUN::FC::Service","Properties": {"ServiceName": "ros_example"}}}} |
The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body exceeds the upper limit, we recommend that you add parameters to the HTTP POST request body to prevent request failures caused by excessively long URLs. You must specify only one of the following parameters: TemplateBody, TemplateURL, TemplateId, and Services.N.ServiceName. |
TemplateURL | String | No | oss://ros-template/demo |
The URL of the file that contains the template body. The URL must point to a template that is located on an HTTP or HTTPS web server or in an Alibaba Cloud Object Storage Service (OSS) bucket, such as oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. The template body must be 1 to 524,288 bytes in length. If you do not specify the region ID of the OSS bucket, the value of the RegionId parameter is used. You must specify only one of the following parameters: TemplateBody, TemplateURL, TemplateId, and Services.N.ServiceName. |
TemplateId | String | No | 5ecd1e10-b0e9-4389-a565-e4c15efc**** |
The ID of the template. This parameter applies to shared and private templates. You must specify only one of the following parameters: TemplateBody, TemplateURL, TemplateId, and Services.N.ServiceName. |
TemplateVersion | String | No | v1 |
The version of the template. If you do not specify this parameter, the latest version is used. This parameter takes effect only when the TemplateId parameter is specified. |
Parameters.N.ParameterKey | String | Yes | Amount |
The name of parameter N. If you do not specify the name and the value of a parameter, Resource Orchestration Service (ROS) uses the default name and value that are specified in the template. Note The Parameters parameter is optional. If you specify the Parameters parameter, you
must specify the Parameters.N.ParameterKey parameter.
|
Parameters.N.ParameterValue | String | Yes | 12 |
The value of parameter N. Note The Parameters parameter is optional. If you specify the Parameters parameter, you
must specify the Parameters.N.ParameterValue parameter.
|
Services.N.ServiceName | String | Yes | EHPC |
The name of service N or feature N. Valid values:
|
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | A9938C04-26AD-5EFA-B394-EA7866842DFF |
The ID of the request. |
ServiceProvisions | Array of ServiceProvision |
Details of the service. |
|
ServiceName | String | EHPC |
The name of the service. |
Status | String | Enabled |
The activation status of the service. Valid values:
|
StatusReason | String | No permission. |
The reason why the service is in the Disabled or Unknown state. Note This parameter is returned if the Status parameter is set to Disabled or Unknown.
|
AutoEnableService | Boolean | false |
Indicates whether automatic activation for the service is defined in the template. Valid values:
|
EnableURL | String | https://common-buy.aliyun.com/?commodityCode=nas |
The URL that points to the activation page of the service. Note This parameter is returned if the Status parameter is set to Disabled.
|
RoleProvision | Object |
The information about the RAM role of the service. If this parameter is empty, no RAM role is associated with the service. |
|
AuthorizationURL | String | https://ehpc.console.aliyun.com/ |
The authorization URL of the RAM role. Note This parameter is returned if the Created parameter is set to false.
|
Roles | Array of Role |
The RAM roles of the service. |
|
RoleName | String | AliyunServiceRoleForEHPC |
The name of the RAM role. |
Created | Boolean | true |
Indicates whether the RAM role is created. Valid values:
|
Function | String | Default |
The purpose for which the RAM role is used. Default value: Default. This value indicates that the RAM role is the default role of the service. |
ApiForCreation | Object |
The information about the API operation that is used to create the RAM role. |
|
ApiProductId | String | rds |
The ID of the Alibaba Cloud service to which the API operation belongs. |
ApiName | String | CreateServiceLinkedRole |
The name of the API operation. |
ApiType | String | Open |
The type of the API operation. Valid values:
|
Parameters | Map |
The parameters of the API operation. If a parameter is a variable, use the ${Variable name} format. Only the following variable is supported: ${RegionId}. |
|
DependentServiceNames | Array of String | NAS |
The names of Alibaba Cloud services on which the service depends. |
Examples
Sample requests
http(s)://ros.aliyuncs.com/?Action=GetServiceProvisions
&RegionId=cn-hangzhou
&ServiceName=EHPC
&<Common request parameters>
Sample success response
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetServiceProvisionsResponse>
<RequestId>A9938C04-26AD-5EFA-B394-EA7866842DFF</RequestId>
<ServiceProvisions>
<ServiceName>EHPC</ServiceName>
<Status>Enabled</Status>
<StatusReason>No permission.</StatusReason>
<AutoEnableService>false</AutoEnableService>
<EnableURL>https://common-buy.aliyun.com/?commodityCode=nas</EnableURL>
<RoleProvision>
<AuthorizationURL>https://ehpc.console.aliyun.com/</AuthorizationURL>
<Roles>
<RoleName>AliyunServiceRoleForEHPC</RoleName>
<Created>true</Created>
<Function>Default</Function>
<ApiForCreation>
<ApiProductId>rds</ApiProductId>
<ApiName>CreateServiceLinkedRole</ApiName>
<ApiType>Open</ApiType>
</ApiForCreation>
</Roles>
</RoleProvision>
<DependentServiceNames>NAS</DependentServiceNames>
</ServiceProvisions>
</GetServiceProvisionsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "A9938C04-26AD-5EFA-B394-EA7866842DFF",
"ServiceProvisions" : {
"ServiceName" : "EHPC",
"Status" : "Enabled",
"StatusReason" : "No permission.",
"AutoEnableService" : false,
"EnableURL" : "https://common-buy.aliyun.com/?commodityCode=nas",
"RoleProvision" : {
"AuthorizationURL" : "https://ehpc.console.aliyun.com/",
"Roles" : {
"RoleName" : "AliyunServiceRoleForEHPC",
"Created" : true,
"Function" : "Default",
"ApiForCreation" : {
"ApiProductId" : "rds",
"ApiName" : "CreateServiceLinkedRole",
"ApiType" : "Open"
}
}
},
"DependentServiceNames" : "NAS"
}
}
Error codes
For a list of error codes, see Service error codes.