Amazon.IoT.AmazonIoTClient.CreatePolicyVersionAsync C# (CSharp) Метод

CreatePolicyVersionAsync() публичный Метод

Creates a new version of the specified AWS IoT policy. To update a policy, create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must use DeletePolicyVersion to delete an existing version before you create a new one.

Optionally, you can set the new version as the policy's default version. The default version is the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

/// An unexpected error has occurred. /// /// The request is not valid. /// /// The policy documentation is not valid. /// /// The specified resource does not exist. /// /// The service is temporarily unavailable. /// /// The rate exceeds the limit. /// /// You are not authorized to perform this operation. /// /// The number of policy versions exceeds the limit. ///
public CreatePolicyVersionAsync ( string policyName, string policyDocument, bool setAsDefault, System cancellationToken = default(CancellationToken) ) : Task
policyName string The policy name.
policyDocument string The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespaces
setAsDefault bool Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<CreatePolicyVersionResponse> CreatePolicyVersionAsync(string policyName, string policyDocument, bool setAsDefault, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new CreatePolicyVersionRequest();
            request.PolicyName = policyName;
            request.PolicyDocument = policyDocument;
            request.SetAsDefault = setAsDefault;
            return CreatePolicyVersionAsync(request, cancellationToken);
        }

Same methods

AmazonIoTClient::CreatePolicyVersionAsync ( CreatePolicyVersionRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIoTClient::CreatePolicyVersionAsync ( string policyName, string policyDocument, System cancellationToken = default(CancellationToken) ) : Task
AmazonIoTClient