ListAccessBindings
Lists existing access bindings for the specified DNS zone.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListAccessBindingsRequest =
cloudApi.access.access.ListAccessBindingsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DnsZoneServiceClient);
const result = await client.listAccessBindings(
access.ListAccessBindingsRequest.fromPartial({
resourceId: "resourceId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dns.v1.dns_zone_service_pb2_grpc import DnsZoneServiceStub
from yandex.cloud.access.access_pb2 import ListAccessBindingsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DnsZoneServiceStub)
response = service.ListAccessBindings(
ListAccessBindingsRequest(
resource_id="resourceId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListAccessBindingsRequest
resourceId
: string
ID of the resource to list access bindings for.
To get the resource ID, use a corresponding List request. For example, use the yandex.cloud.resourcemanager.v1.CloudService.List request to get the Cloud resource ID.
pageSize
: int64
The maximum number of results per page that should be returned. If the number of available results is larger than page_size, the service returns a ListAccessBindingsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.
pageToken
: string
Page token. Set page_token to the ListAccessBindingsResponse.next_page_token returned by a previous list request to get the next page of results.
ListAccessBindingsResponse
accessBindings
: AccessBinding
List of access bindings for the specified resource.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListAccessBindingsRequest.page_size, use the next_page_token as the value for the ListAccessBindingsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.
AccessBinding
roleId
: string
ID of the yandex.cloud.iam.v1.Role that is assigned to the subject.
subject
: Subject
Identity for which access binding is being created. It can represent an account with a unique ID or several accounts with a system identifier.
Subject
id
: string
ID of the subject.
It can contain one of the following values:
allAuthenticatedUsers
: A special public group that represents anyone who is authenticated. It can be used only if the type issystem
.allUsers
: A special public group that represents anyone. No authentication is required. For example, you don't need to specify the IAM token in an API query. It can be used only if the type issystem
.group:organization:<id>:users
: A special system group that represents all members of organization with given <id>. It can be used only if the type issystem
.group:federation:<id>:users
: A special system group that represents all users of federation with given <id>. It can be used only if the type issystem
.<cloud generated id>
: An identifier that represents a user account. It can be used only if the type isuserAccount
,federatedUser
orserviceAccount
.
type
: string
Type of the subject.
It can contain one of the following values:
userAccount
: An account on Yandex or Yandex Connect, added to Yandex Cloud.serviceAccount
: A service account. This type represents the yandex.cloud.iam.v1.ServiceAccount resource.federatedUser
: A federated account. This type represents a user from an identity federation, like Active Directory.system
: System group. This type represents several accounts with a common system identifier.
For more information, see Subject to which the role is assigned.