Skip to content

list_access_grants_locations

list_access_grants_locations(
    account_id: AccountId,
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
    next_token: Optional[ContinuationToken] = None,
    max_results: Optional[MaxResults] = None,
    location_scope: Optional[S3Prefix] = None,
) -> ListAccessGrantsLocationsResult

Returns a list of the locations registered in your S3 Access Grants instance.

Permissions

You must have the s3:ListAccessGrantsLocations permission to use this operation.

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID of the S3 Access Grants instance.

  • next_token (Optional[ContinuationToken], default: None ) –

    A pagination token to request the next page of results. Pass this value into a subsequent List Access Grants Locations request in order to retrieve the next page of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of access grants that you would like returned in the List Access Grants response. If the results include the pagination token NextToken, make another call using the NextToken to determine if there are more results.

  • location_scope (Optional[S3Prefix], default: None ) –

    The S3 path to the location that you are registering. The location scope can be the default S3 location s3://, the S3 path to a bucket s3://, or the S3 path to a bucket and prefix s3:///. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the engineering/ prefix or object key names that start with the marketing/campaigns/ prefix.

Raises:

Source code in docs_src/capo_s3_control/_services/s3_control.py
def list_access_grants_locations(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
    next_token: Optional[
        "capo_s3_control.types.continuation_token.ContinuationToken"
    ] = None,
    max_results: Optional["capo_s3_control.types.max_results.MaxResults"] = None,
    location_scope: Optional["capo_s3_control.types.s3_prefix.S3Prefix"] = None,
) -> "capo_s3_control.types.list_access_grants_locations_result.ListAccessGrantsLocationsResult":
    """<p>Returns a list of the locations registered in your S3 Access Grants instance.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:ListAccessGrantsLocations</code> permission to use this operation. </p> </dd> </dl>

    Args:
        account_id: <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
        next_token: <p>A pagination token to request the next page of results. Pass this value into a subsequent <code>List Access Grants Locations</code> request in order to retrieve the next page of results.</p>
        max_results: <p>The maximum number of access grants that you would like returned in the <code>List Access Grants</code> response. If the results include the pagination token <code>NextToken</code>, make another call using the <code>NextToken</code> to determine if there are more results.</p>
        location_scope: <p>The S3 path to the location that you are registering. The location scope can be the default S3 location <code>s3://</code>, the S3 path to a bucket <code>s3://<bucket></code>, or the S3 path to a bucket and prefix <code>s3://<bucket>/<prefix></code>. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the <code>engineering/</code> prefix or object key names that start with the <code>marketing/campaigns/</code> prefix.</p>

    Raises:
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3_control.types.list_access_grants_locations_request.ListAccessGrantsLocationsRequest]",
    ) -> OperationResponse[
        "capo_s3_control.types.list_access_grants_locations_result.ListAccessGrantsLocationsResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.list_access_grants_locations

        output, http_response = (
            capo_s3_control._operations.awss3_control_service_v20180820.list_access_grants_locations.list_access_grants_locations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAccessGrantsLocations")
    )
    input_: capo_s3_control.types.list_access_grants_locations_request.ListAccessGrantsLocationsRequest = {
        "account_id": account_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if location_scope is not None:
        input_["location_scope"] = location_scope

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output