Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Virtual Private Cloud
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Cloud network
      • Creating a cloud network
      • Deleting a cloud network
      • Updating a cloud network
    • Subnet
      • Creating a subnet
      • Deleting a subnet
      • Updating a subnet
    • IP address
      • Reserving a static public IP address
      • Making a dynamic public IP address static
      • Making a static public IP address dynamic
      • Deleting a static public IP address
    • Static routes
      • Creating a static route
      • Enabling NAT to the internet
    • Security groups
      • Create a security group
      • Update a security group and rules
      • Delete a security group
    • DDoS Protection
      • Enable protection from DDoS attacks
  • Use cases
    • Architecture and protection of a basic internet service
  • Concepts
    • Relationship between service resources
    • Cloud networks and subnets
    • Cloud resource addresses
    • Static routes
    • Security groups
    • MTU and MSS
    • DHCP settings
    • Quotas and limits
  • DDoS Protection
  • Cloud Interconnect
  • Access management
  • Pricing policy
    • Current policy
    • Archive
      • Policy before January 1, 2019
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • AddressService
      • NetworkService
      • RouteTableService
      • SecurityGroupService
      • SubnetService
      • OperationService
    • REST
      • Overview
      • Address
        • Overview
        • create
        • delete
        • get
        • getByValue
        • list
        • listOperations
        • update
      • Network
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • listSubnets
        • move
        • update
      • RouteTable
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • SecurityGroup
        • Overview
      • Subnet
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
  1. API reference
  2. gRPC
  3. SubnetService

SubnetService

  • Calls SubnetService
  • Get
    • GetSubnetRequest
    • Subnet
    • DhcpOptions
  • List
    • ListSubnetsRequest
    • ListSubnetsResponse
    • Subnet
    • DhcpOptions
  • Create
    • CreateSubnetRequest
    • DhcpOptions
    • Operation
    • CreateSubnetMetadata
    • Subnet
    • DhcpOptions
  • Update
    • UpdateSubnetRequest
    • DhcpOptions
    • Operation
    • UpdateSubnetMetadata
    • Subnet
    • DhcpOptions
  • Delete
    • DeleteSubnetRequest
    • Operation
    • DeleteSubnetMetadata
  • ListOperations
    • ListSubnetOperationsRequest
    • ListSubnetOperationsResponse
    • Operation
  • Move
    • MoveSubnetRequest
    • Operation
    • MoveSubnetMetadata
    • Subnet
    • DhcpOptions
  • ListUsedAddresses
    • ListUsedAddressesRequest
    • ListUsedAddressesResponse
    • UsedAddress

A set of methods for managing Subnet resources.

Call Description
Get Returns the specified Subnet resource.
List Retrieves the list of Subnet resources in the specified folder.
Create Creates a subnet in the specified folder and network.
Update Updates the specified subnet.
Delete Deletes the specified subnet.
ListOperations List operations for the specified subnet.
Move Move subnet to another folder.
ListUsedAddresses List used addresses in specified subnet.

Calls SubnetService

Get

Returns the specified Subnet resource.
To get the list of available Subnet resources, make a List request.

rpc Get (GetSubnetRequest) returns (Subnet)

GetSubnetRequest

Field Description
subnet_id string
Required. ID of the Subnet resource to return. To get the subnet ID use a SubnetService.List request. The maximum string length in characters is 50.

Subnet

Field Description
id string
ID of the subnet.
folder_id string
ID of the folder that the subnet belongs to.
created_at google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name string
Name of the subnet. The name is unique within the project. 3-63 characters long.
description string
Optional description of the subnet. 0-256 characters long.
labels map<string,string>
Resource labels as key:value pairs. Мaximum of 64 per resource.
network_id string
ID of the network the subnet belongs to.
zone_id string
ID of the availability zone where the subnet resides.
v4_cidr_blocks[] string
v6_cidr_blocks[] string
IPv6 not available yet.
route_table_id string
ID of route table the subnet is linked to.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

List

Retrieves the list of Subnet resources in the specified folder.

rpc List (ListSubnetsRequest) returns (ListSubnetsResponse)

ListSubnetsRequest

Field Description
folder_id string
Required. ID of the folder to list subnets in. To get the folder ID use a yandex.cloud.resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50.
page_size int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListSubnetsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100. The maximum value is 1000.
page_token string
Page token. To get the next page of results, set page_token to the ListSubnetsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100.
filter string
  1. The field name. Currently you can use filtering only on Subnet.name field.
  2. An operator. Can be either = or != for single values, IN or NOT IN for lists of values.
  3. The value. Must be 3-63 characters long and match the regular expression ^[a-z][-a-z0-9]{1,61}[a-z0-9]$.
The maximum string length in characters is 1000.

ListSubnetsResponse

Field Description
subnets[] Subnet
List of Subnet resources.
next_page_token string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListSubnetsRequest.page_size, use the next_page_token as the value for the ListSubnetsRequest.page_token query parameter in the next list request. Subsequent list requests will have their own next_page_token to continue paging through the results.

Subnet

Field Description
id string
ID of the subnet.
folder_id string
ID of the folder that the subnet belongs to.
created_at google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name string
Name of the subnet. The name is unique within the project. 3-63 characters long.
description string
Optional description of the subnet. 0-256 characters long.
labels map<string,string>
Resource labels as key:value pairs. Мaximum of 64 per resource.
network_id string
ID of the network the subnet belongs to.
zone_id string
ID of the availability zone where the subnet resides.
v4_cidr_blocks[] string
v6_cidr_blocks[] string
IPv6 not available yet.
route_table_id string
ID of route table the subnet is linked to.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

Create

Creates a subnet in the specified folder and network. Method starts an asynchronous operation that can be cancelled while it is in progress.

rpc Create (CreateSubnetRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:CreateSubnetMetadata

    Operation.response:Subnet

CreateSubnetRequest

Field Description
folder_id string
Required. ID of the folder to create a subnet in. To get folder ID use a yandex.cloud.resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50.
name string
Name of the subnet. The name must be unique within the folder. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].
description string
Description of the subnet. The maximum string length in characters is 256.
labels map<string,string>
Resource labels, key:value pairs. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*.
network_id string
Required. ID of the network to create subnet in. The maximum string length in characters is 50.
zone_id string
Required. ID of the availability zone where the subnet resides. To get a list of available zones, use the yandex.cloud.compute.v1.ZoneService.List request. The maximum string length in characters is 50.
v4_cidr_blocks[] string
Required.
route_table_id string
IPv6 not available yet. repeated string v6_cidr_blocks = 8; ID of route table the subnet is linked to. The maximum string length in characters is 50.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<CreateSubnetMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<Subnet>
if operation finished successfully.

CreateSubnetMetadata

Field Description
subnet_id string
ID of the subnet that is being created.

Subnet

Field Description
id string
ID of the subnet.
folder_id string
ID of the folder that the subnet belongs to.
created_at google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name string
Name of the subnet. The name is unique within the project. 3-63 characters long.
description string
Optional description of the subnet. 0-256 characters long.
labels map<string,string>
Resource labels as key:value pairs. Мaximum of 64 per resource.
network_id string
ID of the network the subnet belongs to.
zone_id string
ID of the availability zone where the subnet resides.
v4_cidr_blocks[] string
v6_cidr_blocks[] string
IPv6 not available yet.
route_table_id string
ID of route table the subnet is linked to.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

Update

Updates the specified subnet. Method starts an asynchronous operation that can be cancelled while it is in progress.

rpc Update (UpdateSubnetRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:UpdateSubnetMetadata

    Operation.response:Subnet

UpdateSubnetRequest

Field Description
subnet_id string
Required. ID of the Subnet resource to update. The maximum string length in characters is 50.
update_mask google.protobuf.FieldMask
Field mask that specifies which fields of the Subnet resource are going to be updated.
name string
Name of the subnet. The name must be unique within the folder. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].
description string
Description of the subnet. The maximum string length in characters is 256.
labels map<string,string>
Resource labels as key:value pairs. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*.
route_table_id string
ID of route table the subnet is linked to. The maximum string length in characters is 50.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<UpdateSubnetMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<Subnet>
if operation finished successfully.

UpdateSubnetMetadata

Field Description
subnet_id string
ID of the Subnet resource that is being updated.

Subnet

Field Description
id string
ID of the subnet.
folder_id string
ID of the folder that the subnet belongs to.
created_at google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name string
Name of the subnet. The name is unique within the project. 3-63 characters long.
description string
Optional description of the subnet. 0-256 characters long.
labels map<string,string>
Resource labels as key:value pairs. Мaximum of 64 per resource.
network_id string
ID of the network the subnet belongs to.
zone_id string
ID of the availability zone where the subnet resides.
v4_cidr_blocks[] string
v6_cidr_blocks[] string
IPv6 not available yet.
route_table_id string
ID of route table the subnet is linked to.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

Delete

Deletes the specified subnet.

rpc Delete (DeleteSubnetRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:DeleteSubnetMetadata

    Operation.response:google.protobuf.Empty

DeleteSubnetRequest

Field Description
subnet_id string
Required. ID of the subnet to delete. To get the subnet ID use a SubnetService.List request. The maximum string length in characters is 50.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<DeleteSubnetMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<google.protobuf.Empty>
if operation finished successfully.

DeleteSubnetMetadata

Field Description
subnet_id string
ID of the Subnet resource that is being deleted.

ListOperations

List operations for the specified subnet.

rpc ListOperations (ListSubnetOperationsRequest) returns (ListSubnetOperationsResponse)

ListSubnetOperationsRequest

Field Description
subnet_id string
Required. ID of the Subnet resource to list operations for. The maximum string length in characters is 50.
page_size 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 ListSubnetOperationsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100. The maximum value is 1000.
page_token string
Page token. To get the next page of results, set page_token to the ListSubnetOperationsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100.

ListSubnetOperationsResponse

Field Description
operations[] operation.Operation
List of operations for the specified Subnet resource.
next_page_token string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListSubnetOperationsRequest.page_size, use the next_page_token as the value for the ListSubnetOperationsRequest.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.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any
The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

Move

Move subnet to another folder.

rpc Move (MoveSubnetRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:MoveSubnetMetadata

    Operation.response:Subnet

MoveSubnetRequest

Field Description
subnet_id string
Required. ID of the Subnet resource to move. The maximum string length in characters is 50.
destination_folder_id string
Required. ID of the destination folder. The maximum string length in characters is 50.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<MoveSubnetMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<Subnet>
if operation finished successfully.

MoveSubnetMetadata

Field Description
subnet_id string
ID of the Subnet resource that is being moved.

Subnet

Field Description
id string
ID of the subnet.
folder_id string
ID of the folder that the subnet belongs to.
created_at google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name string
Name of the subnet. The name is unique within the project. 3-63 characters long.
description string
Optional description of the subnet. 0-256 characters long.
labels map<string,string>
Resource labels as key:value pairs. Мaximum of 64 per resource.
network_id string
ID of the network the subnet belongs to.
zone_id string
ID of the availability zone where the subnet resides.
v4_cidr_blocks[] string
v6_cidr_blocks[] string
IPv6 not available yet.
route_table_id string
ID of route table the subnet is linked to.
dhcp_options DhcpOptions

DhcpOptions

Field Description
domain_name_servers[] string
domain_name string
ntp_servers[] string

ListUsedAddresses

List used addresses in specified subnet.

rpc ListUsedAddresses (ListUsedAddressesRequest) returns (ListUsedAddressesResponse)

ListUsedAddressesRequest

Field Description
subnet_id string
Required.
page_size int64
page_token string
filter string

ListUsedAddressesResponse

Field Description
addresses[] UsedAddress
next_page_token string

UsedAddress

Field Description
address string
ip_version enum IpVersion
    references[] reference.Reference
    In this article:
    • Calls SubnetService
    • Get
    • GetSubnetRequest
    • Subnet
    • DhcpOptions
    • List
    • ListSubnetsRequest
    • ListSubnetsResponse
    • Subnet
    • DhcpOptions
    • Create
    • CreateSubnetRequest
    • DhcpOptions
    • Operation
    • CreateSubnetMetadata
    • Subnet
    • DhcpOptions
    • Update
    • UpdateSubnetRequest
    • DhcpOptions
    • Operation
    • UpdateSubnetMetadata
    • Subnet
    • DhcpOptions
    • Delete
    • DeleteSubnetRequest
    • Operation
    • DeleteSubnetMetadata
    • ListOperations
    • ListSubnetOperationsRequest
    • ListSubnetOperationsResponse
    • Operation
    • Move
    • MoveSubnetRequest
    • Operation
    • MoveSubnetMetadata
    • Subnet
    • DhcpOptions
    • ListUsedAddresses
    • ListUsedAddressesRequest
    • ListUsedAddressesResponse
    • UsedAddress
    Language
    Careers
    Privacy policy
    Terms of use
    © 2021 Yandex.Cloud LLC