Associates the specified IP access control group with the specified directory.
Parameters:
-
directory_id
(DirectoryId)
–
The identifier of the directory.
-
group_ids
(IpGroupIdList)
–
The identifiers of one or more IP access control groups.
Raises:
Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
| async def associate_ip_groups(
self,
directory_id: "capo_workspaces.types.directory_id.DirectoryId",
group_ids: "capo_workspaces.types.ip_group_id_list.IpGroupIdList",
*,
config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.associate_ip_groups_result.AssociateIpGroupsResult":
"""<p>Associates the specified IP access control group with the specified directory.</p>
Args:
directory_id: <p>The identifier of the directory.</p>
group_ids: <p>The identifiers of one or more IP access control groups.</p>
Raises:
capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
capo_workspaces.errors.invalid_parameter_values_exception.InvalidParameterValuesException: <p>One or more parameter values are not valid.</p>
capo_workspaces.errors.invalid_resource_state_exception.InvalidResourceStateException: <p>The state of the resource is not valid for this operation.</p>
capo_workspaces.errors.operation_not_supported_exception.OperationNotSupportedException: <p>This operation is not supported.</p>
capo_workspaces.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>Your resource limits have been exceeded.</p>
capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_workspaces.types.associate_ip_groups_request.AssociateIpGroupsRequest]",
) -> AsyncOperationResponse[
"capo_workspaces.types.associate_ip_groups_result.AssociateIpGroupsResult"
]:
import capo_workspaces._operations.workspaces_service.associate_ip_groups
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.associate_ip_groups.async_associate_ip_groups(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateIpGroups")
)
input_: capo_workspaces.types.associate_ip_groups_request.AssociateIpGroupsRequest = {
"directory_id": directory_id,
"group_ids": group_ids,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|