
# 列出应用程序实例 - ListApplicationInstances
#### 功能介绍
列出应用程序实例。此操作只能由组织的管理账号或作为服务委托管理员的成员账号调用。
#### 授权信息
账号根用户具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备如下身份策略权限，更多的权限说明请参见[权限和授权项](https://support.huaweicloud.com/api-identitycenter/iic_04_0028.html)。
| 授权项                                                 | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|:---|:---|
| IdentityCenter:application:listApplicationInstances | List | -           | -   | -  | - organizations:delegatedAdministrators:list  - IdentityCenter:application:getApplicationInstance   |
   
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IdentityCenter/doc?api=ListApplicationInstances)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
GET /v1/instances/{instance_id}/application-instances
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                |
|:---|:---|:---|:---|
| instance_id | 是    | String | IAM Identity Center实例的全局唯一标识符（ID） |
   
表2Query参数 
| 参数     | 是否必选 | 参数类型    | 描述            |
|:---|:---|:---|:---|
| limit  | 否    | Integer | 每个请求返回的最大结果数。 |
| marker | 否    | String  | 分页标记          |
   
#### 请求参数
表3请求Header参数 
| 参数               | 是否必选 | 参数类型   | 描述                                              |
|:---|:---|:---|:---|
| X-Security-Token | 否    | String | 如果正在使用临时安全凭据，则此header是必需的，该值是临时安全凭据的安全令牌（会话令牌）。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数                    | 参数类型                                                                                                  | 描述       |
|:---|:---|:---|
| application_instances | Array of [ApplicationInstanceDto] objects | 应用程序实例列表 |
| page_info             | [PageInfoDto] object                                 | 分页信息     |
   
 表5ApplicationInstanceDto 
| 参数                       | 参数类型                                                                                              | 描述                 |
|:---|:---|:---|
| active_certificate       | [CertificateDto] object                       | 已激活的证书             |
| display                  | [DisplayDto] object                               | 应用程序显示信息           |
| identity_provider_config | [IdentityProviderConfigDto] object | 身份提供商配置信息          |
| application_instance_id  | String                                                                                            | 应用程序实例唯一标识ID       |
| name                     | String                                                                                            | 应用程序UUID           |
| visible                  | Boolean                                                                                           | 应用程序在门户是否可见        |
| response_config          | [ResponseConfigDto] object                 | 应用程序属性配置信息         |
| response_schema_config   | [ResponseSchemaConfigDto] object     | 应用程序Schema属性映射配置信息 |
| security_config          | [SecurityConfigDto] object                 | 证书配置信息             |
| status                   | String                                                                                            | 应用程序实例状态           |
| template                 | [ApplicationTemplateDto] object       | 应用程序所依赖模板信息        |
| service_provider_config  | [ServiceProviderConfigDto] object   | 服务提供商配置信息          |
| client_id                | String                                                                                            | OIDC Client ID     |
| end_user_visible         | Boolean                                                                                           | 用户是否可见             |
| managed_account          | String                                                                                            | 组员所属账号ID           |
   
 表6CertificateDto 
| 参数             | 参数类型   | 描述       |
|:---|:---|:---|
| algorithm      | String | 证书生成算法   |
| certificate    | String | 应用程序证书   |
| certificate_id | String | 应用程序证书Id |
| expiry_date    | Long   | 证书过期时间   |
| status         | String | 证书状态     |
| key_size       | String | 密钥大小     |
| issue_date     | Long   | 证书生成时间   |
   
 表7IdentityProviderConfigDto 
| 参数                | 参数类型   | 描述          |
|:---|:---|:---|
| issuer_url        | String | 身份提供商issuer |
| metadata_url      | String | 身份提供商元数据    |
| remote_login_url  | String | 身份提供商远程登录链接 |
| remote_logout_url | String | 身份提供商远程登出链接 |
   
 表8ApplicationTemplateDto 
| 参数                      | 参数类型                                                                                                      | 描述           |
|:---|:---|:---|
| application             | [ApplicationTemplateDisplayDto] object | 应用程序模板显示信息   |
| response_config         | [ResponseConfigDto] object                         | 应用程序属性配置信息   |
| response_schema_config  | [ResponseSchemaConfigDto] object             | 应用程序属性映射配置信息 |
| sso_protocol            | String                                                                                                    | 支持的协议        |
| security_config         | [SecurityConfigDto] object                         | 证书配置信息       |
| service_provider_config | [ServiceProviderConfigDto] object           | 服务提供商配置信息    |
| template_id             | String                                                                                                    | 应用程序模板唯一标识ID |
| template_version        | String                                                                                                    | 应用程序模板版本     |
   
 表9ApplicationTemplateDisplayDto 
| 参数               | 参数类型                                                                | 描述              |
|:---|:---|:---|
| application_id   | String                                                              | 应用程序Id,以app-为前缀 |
| display          | [DisplayDto] object | 应用程序显示信息        |
| application_type | String                                                              | 应用程序类型          |
   
 表10DisplayDto 
| 参数           | 参数类型   | 描述       |
|:---|:---|:---|
| description  | String | 应用程序描述   |
| display_name | String | 应用程序显示名称 |
| icon         | String | 应用程序图标   |
   
 表11ResponseConfigDto 
| 参数          | 参数类型                                                                                                   | 描述            |
|:---|:---|:---|
| properties  | Map\<String,[ResponseSourceDetailsDto]\> | 额外添加的属性映射配置   |
| subject     | [ResponseSourceDetailsDto] object        | Subject属性映射配置 |
| relay_state | String                                                                                                 | 中继状态          |
| ttl         | String                                                                                                 | 会话过期时间        |
   
 表12ResponseSourceDetailsDto 
| 参数     | 参数类型             | 描述    |
|:---|:---|:---|
| source | Array of strings | 属性映射值 |
   
 表13ResponseSchemaConfigDto 
| 参数                        | 参数类型                                                                                                                       | 描述                      |
|:---|:---|:---|
| properties                | Map\<String,[ResponseSchemaPropertiesDetailsDto]\> | 额外添加的属性映射Schema配置       |
| subject                   | [ResponseSchemaSubjectDetailsDto] object              | Subject属性映射Schema配置     |
| supported_name_id_formats | Array of strings                                                                                                           | 应用程序支持的Subject NameID格式 |
   
 表14ResponseSchemaPropertiesDetailsDto 
| 参数               | 参数类型   | 描述         |
|:---|:---|:---|
| attr_name_format | String | 额外添加的属性的格式 |
| include          | String | 是否包含额外属性   |
   
 表15ResponseSchemaSubjectDetailsDto 
| 参数             | 参数类型   | 描述         |
|:---|:---|:---|
| name_id_format | String | NameID的格式  |
| include        | String | 是否包含NameID |
   
 表16SecurityConfigDto 
| 参数  | 参数类型   | 描述     |
|:---|:---|:---|
| ttl | String | 证书过期时间 |
   
 表17ServiceProviderConfigDto 
| 参数                        | 参数类型                                                                              | 描述        |
|:---|:---|:---|
| audience                  | String                                                                            | SAML受众    |
| require_request_signature | Boolean                                                                           | 是否需要签名    |
| consumers                 | Array of [ConsumersDto] objects | SAML响应接收方 |
| start_url                 | String                                                                            | 应用程序启动Url |
   
 表18ConsumersDto 
| 参数            | 参数类型    | 描述           |
|:---|:---|:---|
| binding       | String  | SAML传输协议     |
| default_value | Boolean | 是否是默认接收方     |
| location      | String  | SAML ACS Url |
   
 表19PageInfoDto 
| 参数            | 参数类型    | 描述                                                                                             |
|:---|:---|:---|
| next_marker   | String  | 如果存在，则表示可用的输出比当前响应中包含的输出多。在对操作的后续调用中，在标签请求参数中使用此值，以获取输出的下一部分。您应该重复此操作，直到next_marker响应元素返回为null |
| current_count | Integer | 本页返回条目数量                                                                                       |
   
**状态码：400**
表20响应Body参数 
| 参数         | 参数类型   | 描述     |
|:---|:---|:---|
| error_code | String | 错误码    |
| error_msg  | String | 错误信息   |
| request_id | String | 请求唯一标识 |
   
**状态码：403**
表21响应Body参数 
| 参数                            | 参数类型   | 描述      |
|:---|:---|:---|
| error_code                    | String | 错误码     |
| error_msg                     | String | 错误信息    |
| request_id                    | String | 请求唯一标识  |
| encoded_authorization_message | String | 加密的错误信息 |
   
#### 请求示例
列出应用程序实例
```
GET https://{hostname}/v1/instances/{instance_id}/application-instances
```
#### 响应示例
**状态码：200**
Successful
```
{
  "application_instances": [
    {
      "active_certificate": {
        "algorithm": "SHA256withRSA",
        "certificate": "-----BEGIN CERTIFICATE-----\r\nMIIEzDCC***********r7b7bwtA7lyC5wVnaI5uU=\r\n-----END CERTIFICATE-----",
        "certificate_id": "cer-94b6ee1***********0d5cc7f",
        "expiry_date": 1913587200000,
        "status": "ACTIVE",
        "key_size": "3072",
        "issue_date": 1755825219580
      },
      "display": {
        "description": "***********",
        "display_name": "HuaweiCloud IAM",
        "icon": ""
      },
      "identity_provider_config": {
        "issuer_url": "https://idcenter.huaweicloud.com/v1/saml/assertion/OWVjNmY0ZjVkZDI4NDg1***********WUyZGQ0NDIzMGIzMTk1Yg==",
        "metadata_url": "https://idcenter.huaweicloud.com/v1/saml/metadata/OWVjNmY0ZjVkZDI4ND***********ZGQ0NDIzMGIzMTk1Yg==",
        "remote_login_url": "https://idcenter.huaweicloud.com/v1/saml/assertion/OWVjNmY0Zj***********GQ0NDIzMGIzMTk1Yg==",
        "remote_logout_url": "https://idcenter.huaweicloud.com/v1/saml/logout/OWVjNmY0ZjVkZDI4N***********UyZGQ0NDIzMGIzMTk1Yg=="
      },
      "application_instance_id": "app-ins-1e2dd44230b3195b",
      "name": "439977c1-8b******dca7cfc668bc",
      "visible": true,
      "response_config": {
        "properties": {
          "IAM_SAML_Attributes_domain_id": {
            "source": [
              "9ec********8331"
            ]
          },
          "UserName": {
            "source": [
              "${user:name}"
            ]
          },
          "IAM_SAML_Attributes_idp_id": {
            "source": [
              "IdCCCE"
            ]
          },
          "IAM_SAML_Attributes_redirect_url": {
            "source": [
              "https://console.huaweicloud.com/iam/?agencyId=********region=cn-north-4&locale=zh-cn#/iam/users"
            ]
          }
        },
        "subject": {
          "source": [
            "${user:name}"
          ]
        },
        "relay_state": null,
        "ttl": "PT1H"
      },
      "response_schema_config": {
        "properties": {
          "IAM_SAML_Attributes_domain_id": {
            "attr_name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
            "include": "YES"
          },
          "UserName": {
            "attr_name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
            "include": "YES"
          },
          "IAM_SAML_Attributes_idp_id": {
            "attr_name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
            "include": "YES"
          },
          "IAM_SAML_Attributes_redirect_url": {
            "attr_name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
            "include": "YES"
          }
        },
        "subject": {
          "name_id_format": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
          "include": "REQUIRED"
        },
        "supported_name_id_formats": []
      },
      "security_config": {
        "ttl": "P5Y"
      },
      "status": "ENABLED",
      "template": {
        "application": {
          "application_id": "app-ff1258a63a4a263f",
          "display": {
            "description": "Custom SAML 2.0 application",
            "display_name": "Custom SAML 2.0 application",
            "icon": ""
          },
          "application_type": ""
        },
        "response_config": {
          "properties": {},
          "subject": null,
          "relay_state": null,
          "ttl": "PT1H"
        },
        "response_schema_config": {
          "properties": {},
          "subject": null,
          "supported_name_id_formats": null
        },
        "sso_protocol": "SAML",
        "security_config": {
          "ttl": null
        },
        "service_provider_config": {
          "audience": null,
          "require_request_signature": false,
          "consumers": null,
          "start_url": null
        },
        "template_id": "tpl-88f215b39bfc7575",
        "template_version": "1"
      },
      "service_provider_config": {
        "audience": "https://auth.huaweicloud.com/",
        "require_request_signature": true,
        "consumers": [
          {
            "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
            "default_value": true,
            "location": "https://auth.huaweicloud.com/authui/saml/SAMLAssertionConsumer"
          }
        ],
        "start_url": null
      },
      "client_id": null,
      "end_user_visible": null,
      "managed_account": "9ec6f4f5dd***********c5428331"
    }
  ],
  "page_info": {
    "next_marker": null,
    "current_count": 1
  }
}
```
#### 状态码
| 状态码 | 描述          |
|:---|:---|
| 200 | Successful  |
| 400 | Bad request |
| 403 | Forbidden   |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-identitycenter/ErrorCode.html)。
