public class Client
extends com.aliyun.teaopenapi.Client
_ca, _cert, _connectTimeout, _credential, _disableHttp2, _endpoint, _endpointMap, _endpointRule, _endpointType, _globalParameters, _headers, _httpProxy, _httpsProxy, _key, _maxIdleConns, _method, _network, _noProxy, _openPlatformEndpoint, _productId, _protocol, _readTimeout, _regionId, _signatureAlgorithm, _signatureVersion, _socks5NetWork, _socks5Proxy, _spi, _suffix, _tlsMinVersion, _userAgent| 构造器和说明 |
|---|
Client(com.aliyun.teaopenapi.models.Config config) |
| 限定符和类型 | 方法和说明 |
|---|---|
AssumeRoleResponse |
assumeRole(AssumeRoleRequest request)
description :
Prerequisites
You cannot use an Alibaba Cloud account to call this operation.
|
AssumeRoleWithOIDCResponse |
assumeRoleWithOIDC(AssumeRoleWithOIDCRequest request)
description :
Prerequisites
An OIDC token is obtained from an external identity provider (IdP).
|
AssumeRoleWithOIDCResponse |
assumeRoleWithOIDCWithOptions(AssumeRoleWithOIDCRequest request,
com.aliyun.teautil.models.RuntimeOptions runtime)
description :
Prerequisites
An OIDC token is obtained from an external identity provider (IdP).
|
AssumeRoleResponse |
assumeRoleWithOptions(AssumeRoleRequest request,
com.aliyun.teautil.models.RuntimeOptions runtime)
description :
Prerequisites
You cannot use an Alibaba Cloud account to call this operation.
|
AssumeRoleWithSAMLResponse |
assumeRoleWithSAML(AssumeRoleWithSAMLRequest request)
description :
A SAML response is obtained from an external identity provider (IdP).
|
AssumeRoleWithSAMLResponse |
assumeRoleWithSAMLWithOptions(AssumeRoleWithSAMLRequest request,
com.aliyun.teautil.models.RuntimeOptions runtime)
description :
A SAML response is obtained from an external identity provider (IdP).
|
GetCallerIdentityResponse |
getCallerIdentity()
summary :
The ID of the Alibaba Cloud account to which the current requester belongs.
|
GetCallerIdentityResponse |
getCallerIdentityWithOptions(com.aliyun.teautil.models.RuntimeOptions runtime)
summary :
The ID of the Alibaba Cloud account to which the current requester belongs.
|
String |
getEndpoint(String productId,
String regionId,
String endpointRule,
String network,
String suffix,
Map<String,String> endpointMap,
String endpoint) |
addRequestInterceptor, addResponseInterceptor, addRuntimeOptionsInterceptor, callApi, checkConfig, defaultAny, doRequest, doROARequest, doROARequestWithForm, doRPCRequest, execute, getAccessKeyId, getAccessKeySecret, getBearerToken, getRpcHeaders, getSecurityToken, getType, getUserAgent, setGatewayClient, setRpcHeaderspublic String getEndpoint(String productId, String regionId, String endpointRule, String network, String suffix, Map<String,String> endpointMap, String endpoint) throws Exception
Exceptionpublic AssumeRoleResponse assumeRoleWithOptions(AssumeRoleRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception
You cannot use an Alibaba Cloud account to call this operation. The requester of this operation can only be a RAM user or RAM role. Make sure that the AliyunSTSAssumeRoleAccess policy is attached to the requester. After this policy is attached to the requester, the requester has the management permissions on STS.
If you do not attach the AliyunSTSAssumeRoleAccess policy to the requester, the following error message is returned:
You are not authorized to do this action. You should be authorized by RAM.
You can refer to the following information to troubleshoot the error:
An STS token is valid for a period of time after it is issued, and the number of STS tokens that can be issued within an interval is also limited. Therefore, we recommend that you configure a proper validity period for an STS token and repeatedly use the token within this period. This prevents frequent issuing of STS tokens from adversely affecting your services if a large number of requests are sent. For more information about the limit, see Is the number of STS API requests limited? You can configure the DurationSeconds parameter to specify a validity period for an STS token.
When you upload or download Object Storage Service (OSS) objects on mobile devices, a large number of STS API requests are sent. In this case, repeated use of an STS token may not meet your business requirements. To avoid the limit on STS API requests from affecting access to OSS, you can add a signature to the URL of an OSS object. For more information, see Add signatures to URLs and Obtain signature information from the server and upload data to OSS.
Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role.
request - AssumeRoleRequestruntime - runtime options for this request RuntimeOptionsExceptionpublic AssumeRoleResponse assumeRole(AssumeRoleRequest request) throws Exception
You cannot use an Alibaba Cloud account to call this operation. The requester of this operation can only be a RAM user or RAM role. Make sure that the AliyunSTSAssumeRoleAccess policy is attached to the requester. After this policy is attached to the requester, the requester has the management permissions on STS.
If you do not attach the AliyunSTSAssumeRoleAccess policy to the requester, the following error message is returned:
You are not authorized to do this action. You should be authorized by RAM.
You can refer to the following information to troubleshoot the error:
An STS token is valid for a period of time after it is issued, and the number of STS tokens that can be issued within an interval is also limited. Therefore, we recommend that you configure a proper validity period for an STS token and repeatedly use the token within this period. This prevents frequent issuing of STS tokens from adversely affecting your services if a large number of requests are sent. For more information about the limit, see Is the number of STS API requests limited? You can configure the DurationSeconds parameter to specify a validity period for an STS token.
When you upload or download Object Storage Service (OSS) objects on mobile devices, a large number of STS API requests are sent. In this case, repeated use of an STS token may not meet your business requirements. To avoid the limit on STS API requests from affecting access to OSS, you can add a signature to the URL of an OSS object. For more information, see Add signatures to URLs and Obtain signature information from the server and upload data to OSS.
Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role.
request - AssumeRoleRequestExceptionpublic AssumeRoleWithOIDCResponse assumeRoleWithOIDCWithOptions(AssumeRoleWithOIDCRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception
Queries a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using OpenID Connect (OIDC).
request - AssumeRoleWithOIDCRequestruntime - runtime options for this request RuntimeOptionsExceptionpublic AssumeRoleWithOIDCResponse assumeRoleWithOIDC(AssumeRoleWithOIDCRequest request) throws Exception
Queries a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using OpenID Connect (OIDC).
request - AssumeRoleWithOIDCRequestExceptionpublic AssumeRoleWithSAMLResponse assumeRoleWithSAMLWithOptions(AssumeRoleWithSAMLRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception
Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using Security Assertion Markup Language (SAML).
request - AssumeRoleWithSAMLRequestruntime - runtime options for this request RuntimeOptionsExceptionpublic AssumeRoleWithSAMLResponse assumeRoleWithSAML(AssumeRoleWithSAMLRequest request) throws Exception
Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using Security Assertion Markup Language (SAML).
request - AssumeRoleWithSAMLRequestExceptionpublic GetCallerIdentityResponse getCallerIdentityWithOptions(com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception
The ID of the Alibaba Cloud account to which the current requester belongs.
request - GetCallerIdentityRequestruntime - runtime options for this request RuntimeOptionsExceptionpublic GetCallerIdentityResponse getCallerIdentity() throws Exception
The ID of the Alibaba Cloud account to which the current requester belongs.
ExceptionCopyright © 2025. All rights reserved.