Container for the parameters to the ModifyClusterIamRoles operation. Modifies the list of AWS Identity and Access Management (IAM) roles that can be used by the cluster to access other AWS services.

A cluster can have up to 10 IAM roles associated at any time.

Inheritance: AmazonRedshiftRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Redshift.Model.ModifyClusterIamRolesRequest();

            if (cmdletContext.AddIamRole != null)
            {
                request.AddIamRoles = cmdletContext.AddIamRole;
            }
            if (cmdletContext.ClusterIdentifier != null)
            {
                request.ClusterIdentifier = cmdletContext.ClusterIdentifier;
            }
            if (cmdletContext.DefaultIamRoleArn != null)
            {
                request.DefaultIamRoleArn = cmdletContext.DefaultIamRoleArn;
            }
            if (cmdletContext.RemoveIamRole != null)
            {
                request.RemoveIamRoles = cmdletContext.RemoveIamRole;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
Esempio n. 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the ModifyClusterIamRoles operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ModifyClusterIamRoles operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<ModifyClusterIamRolesResponse> ModifyClusterIamRolesAsync(ModifyClusterIamRolesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ModifyClusterIamRolesRequestMarshaller();
            var unmarshaller = ModifyClusterIamRolesResponseUnmarshaller.Instance;

            return InvokeAsync<ModifyClusterIamRolesRequest,ModifyClusterIamRolesResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Esempio n. 3
0
        /// <summary>
        /// Modifies the list of AWS Identity and Access Management (IAM) roles that can be used
        /// by the cluster to access other AWS services.
        /// 
        ///  
        /// <para>
        /// A cluster can have up to 10 IAM roles associated at any time.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ModifyClusterIamRoles service method.</param>
        /// 
        /// <returns>The response from the ModifyClusterIamRoles service method, as returned by Redshift.</returns>
        /// <exception cref="Amazon.Redshift.Model.ClusterNotFoundException">
        /// The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster.
        /// </exception>
        /// <exception cref="Amazon.Redshift.Model.InvalidClusterStateException">
        /// The specified cluster is not in the <code>available</code> state.
        /// </exception>
        public ModifyClusterIamRolesResponse ModifyClusterIamRoles(ModifyClusterIamRolesRequest request)
        {
            var marshaller = new ModifyClusterIamRolesRequestMarshaller();
            var unmarshaller = ModifyClusterIamRolesResponseUnmarshaller.Instance;

            return Invoke<ModifyClusterIamRolesRequest,ModifyClusterIamRolesResponse>(request, marshaller, unmarshaller);
        }
 private Amazon.Redshift.Model.ModifyClusterIamRolesResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.ModifyClusterIamRolesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "ModifyClusterIamRoles");
     try
     {
         #if DESKTOP
         return(client.ModifyClusterIamRoles(request));
         #elif CORECLR
         return(client.ModifyClusterIamRolesAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the ModifyClusterIamRoles operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ModifyClusterIamRoles operation on AmazonRedshiftClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndModifyClusterIamRoles
        ///         operation.</returns>
        public IAsyncResult BeginModifyClusterIamRoles(ModifyClusterIamRolesRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ModifyClusterIamRolesRequestMarshaller();
            var unmarshaller = ModifyClusterIamRolesResponseUnmarshaller.Instance;

            return BeginInvoke<ModifyClusterIamRolesRequest>(request, marshaller, unmarshaller,
                callback, state);
        }