Amazon.IdentityManagement.AmazonIdentityManagementServiceClient.ListGroupsAsync C# (CSharp) Метод

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

Lists the IAM groups that have the specified path prefix.

You can paginate the results using the MaxItems and Marker parameters.

/// The request processing has failed because of an unknown error, exception or failure. ///
public ListGroupsAsync ( System cancellationToken = default(CancellationToken) ) : Task
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<ListGroupsResponse> ListGroupsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            return ListGroupsAsync(new ListGroupsRequest(), cancellationToken);
        }

Same methods

AmazonIdentityManagementServiceClient::ListGroupsAsync ( ListGroupsRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIdentityManagementServiceClient::ListGroupsAsync ( ListGroupsResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonIdentityManagementServiceClient::ListGroupsAsync ( ListGroupsRequest request, ListGroupsResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

Пример #1
0
        public static void DeleteUsersAndGroupsInTestNameSpace(AmazonIdentityManagementServiceClient client)
        {
            ListGroupsResponse lgRes = client.ListGroupsAsync(new ListGroupsRequest() { PathPrefix = TEST_PATH }).Result;
            foreach (Group g in lgRes.Groups)
            {
                GetGroupResponse ggRes = client.GetGroupAsync(new GetGroupRequest() { GroupName = g.GroupName }).Result;
                foreach (User u in ggRes.Users)
                {
                    client.RemoveUserFromGroupAsync(new RemoveUserFromGroupRequest() { GroupName = g.GroupName, UserName = u.UserName }).Wait();
                }
                client.DeleteGroupAsync(new DeleteGroupRequest() { GroupName = g.GroupName }).Wait();
            }

            ListUsersResponse luRes = client.ListUsersAsync(new ListUsersRequest() { PathPrefix = TEST_PATH }).Result;
            foreach (User u in luRes.Users)
            {
                DeleteTestUsers(client, u.UserName);
            }
        }
AmazonIdentityManagementServiceClient