Virtual Private Cloud API, gRPC: NetworkService
A set of methods for managing Network resources.
Call | Description |
---|---|
Get | Returns the specified Network resource. |
List | Retrieves the list of Network resources in the specified folder. |
Create | Creates a network in the specified folder using the data specified in the request. |
Update | Updates the specified network. |
Delete | Deletes the specified network. |
ListSubnets | Lists subnets from the specified network. |
ListSecurityGroups | Lists security groups from the specified network. |
ListRouteTables | Lists route tables from the specified network. |
ListOperations | Lists operations for the specified network. |
Move | Move network to another folder. |
Calls NetworkService
Get
Returns the specified Network resource.
Get the list of available Network resources by making a List request.
rpc Get (GetNetworkRequest) returns (Network)
GetNetworkRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network resource to return. To get the network ID, use a NetworkService.List request. The maximum string length in characters is 50. |
Network
Field | Description |
---|---|
id | string ID of the network. |
folder_id | string ID of the folder that the network belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the network. The name is unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Optional description of the network. 0-256 characters long. |
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]* . |
default_security_group_id | string ID of default security group for network. |
List
Retrieves the list of Network resources in the specified folder.
rpc List (ListNetworksRequest) returns (ListNetworksResponse)
ListNetworksRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder to list networks 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 ListNetworksResponse.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 ListNetworksResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
filter | string A filter expression that filters resources listed in the response. The expression must specify:
|
ListNetworksResponse
Field | Description |
---|---|
networks[] | Network List of Network 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 ListNetworksRequest.page_size, use the next_page_token as the value for the ListNetworksRequest.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. |
Network
Field | Description |
---|---|
id | string ID of the network. |
folder_id | string ID of the folder that the network belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the network. The name is unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Optional description of the network. 0-256 characters long. |
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]* . |
default_security_group_id | string ID of default security group for network. |
Create
Creates a network in the specified folder using the data specified in the request. Method starts an asynchronous operation that can be cancelled while it is in progress.
rpc Create (CreateNetworkRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:CreateNetworkMetadata
Operation.response:Network
CreateNetworkRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder for this request to create a network in. To get the folder ID, use a yandex.cloud.resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50. |
name | string Name of the network. The name must be unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Description of the network. 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]* . |
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 if operation finished successfully. |
CreateNetworkMetadata
Field | Description |
---|---|
network_id | string ID of the Network that is being created. |
Network
Field | Description |
---|---|
id | string ID of the network. |
folder_id | string ID of the folder that the network belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the network. The name is unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Optional description of the network. 0-256 characters long. |
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]* . |
default_security_group_id | string ID of default security group for network. |
Update
Updates the specified network. Method starts an asynchronous operation that can be cancelled while it is in progress.
rpc Update (UpdateNetworkRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:UpdateNetworkMetadata
Operation.response:Network
UpdateNetworkRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network resource to update. To get the network ID use a NetworkService.List request. The maximum string length in characters is 50. |
update_mask | google.protobuf.FieldMask Field mask that specifies which fields of the Network resource are going to be updated. |
name | string Name of the network. The name must be unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Description of the network. 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]* . |
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 if operation finished successfully. |
UpdateNetworkMetadata
Field | Description |
---|---|
network_id | string ID of the Network resource that is being updated. |
Network
Field | Description |
---|---|
id | string ID of the network. |
folder_id | string ID of the folder that the network belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the network. The name is unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Optional description of the network. 0-256 characters long. |
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]* . |
default_security_group_id | string ID of default security group for network. |
Delete
Deletes the specified network.
rpc Delete (DeleteNetworkRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DeleteNetworkMetadata
Operation.response:google.protobuf.Empty
DeleteNetworkRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network resource to update. To get the network ID, use a NetworkService.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 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 if operation finished successfully. |
DeleteNetworkMetadata
Field | Description |
---|---|
network_id | string ID of the network that is being deleted. |
ListSubnets
Lists subnets from the specified network.
rpc ListSubnets (ListNetworkSubnetsRequest) returns (ListNetworkSubnetsResponse)
ListNetworkSubnetsRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network resource to list subnets 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 ListNetworkSubnetsResponse.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. Set page_token to the ListNetworkSubnetsResponse.next_page_token returned by a previous list request to get the next page of results. The maximum string length in characters is 100. |
ListNetworkSubnetsResponse
Field | Description |
---|---|
subnets[] | Subnet List of subnets that belong to the network which is specified in the request. |
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 ListNetworkSubnetsRequest.page_size, use the next_page_token as the value for the ListNetworkSubnetsRequest.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 |
name | string Name of the subnet. The name must be unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Optional description of the subnet. 0-256 characters long. |
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 ID of the network the subnet belongs to. |
zone_id | string ID of the availability zone where the subnet resides. |
v4_cidr_blocks[] | string CIDR block. The range of internal addresses that are defined for this subnet. This field can be set only at Subnet resource creation time and cannot be changed. For example, 10.0.0.0/22 or 192.168.0.0/24. Minimum subnet size is /28, maximum subnet size is /16. |
v6_cidr_blocks[] | string IPv6 not available yet. |
route_table_id | string ID of route table the subnet is linked to. |
dhcp_options | DhcpOptions DHCP options for the subnet. |
DhcpOptions
Field | Description |
---|---|
domain_name_servers[] | string A list of DHCP servers for this subnet. |
domain_name | string A domain name to us as a suffix when resolving host names in this subnet. |
ntp_servers[] | string List of NTP servers for this subnet. |
ListSecurityGroups
Lists security groups from the specified network.
rpc ListSecurityGroups (ListNetworkSecurityGroupsRequest) returns (ListNetworkSecurityGroupsResponse)
ListNetworkSecurityGroupsRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network resource to list security groups 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 ListNetworkSecurityGroupsResponse.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. Set page_token to the ListNetworkSecurityGroupsResponse.next_page_token returned by a previous list request to get the next page of results. The maximum string length in characters is 100. |
ListNetworkSecurityGroupsResponse
Field | Description |
---|---|
security_groups[] | SecurityGroup List of security groups that belong to the network which is specified in the request. |
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 ListNetworkSecurityGroupsRequest.page_size, use the next_page_token as the value for the ListNetworkSecurityGroupsRequest.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. |
SecurityGroup
Field | Description |
---|---|
id | string ID of the security group. |
folder_id | string ID of the folder that the security group belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the security group. The name must be unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Description of the security group. 0-256 characters long. |
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]* . |
network_id | string ID of the network that the security group belongs to. |
status | enum Status Security group status.
|
rules[] | SecurityGroupRule List of the security group rules. |
default_for_network | bool Flag that indicates that the security group is the default for the network. |
SecurityGroupRule
Field | Description |
---|---|
id | string ID of the rule. |
description | string Description of the rule. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
direction | enum Direction Required. The direction of network traffic allowed by this rule.
|
ports | PortRange The range of ports that allow traffic to pass through. Null value means any. |
protocol_name | string Protocol name. Null value means any protocol. Values from IANA |
protocol_number | int64 Protocol number from IANA protocol numbers |
target | oneof: cidr_blocks , security_group_id or predefined_target |
cidr_blocks | CidrBlocks CIDR blocks to allow to recieve or send traffic. |
security_group_id | string ID of the security group to add rule to. |
predefined_target | string Predefined target. See security groups rules for more information. |
PortRange
Field | Description |
---|---|
from_port | int64 The lowest port in the range. Acceptable values are 0 to 65535, inclusive. |
to_port | int64 The highest port in the range. Acceptable values are 0 to 65535, inclusive. |
CidrBlocks
Field | Description |
---|---|
v4_cidr_blocks[] | string IPv4 CIDR blocks to allow traffic to. |
v6_cidr_blocks[] | string IPv6 CIDR blocks to allow traffic to. |
ListRouteTables
Lists route tables from the specified network.
rpc ListRouteTables (ListNetworkRouteTablesRequest) returns (ListNetworkRouteTablesResponse)
ListNetworkRouteTablesRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network resource to list route tables 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 ListNetworkRouteTablesResponse.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. Set page_token to the ListNetworkRouteTablesResponse.next_page_token returned by a previous list request to get the next page of results. The maximum string length in characters is 100. |
ListNetworkRouteTablesResponse
Field | Description |
---|---|
route_tables[] | RouteTable List of route tables that belong to the network which is specified in the request. |
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 ListNetworkRouteTablesRequest.page_size, use the next_page_token as the value for the ListNetworkRouteTablesRequest.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. |
RouteTable
Field | Description |
---|---|
id | string ID of the route table. |
folder_id | string ID of the folder that the route table belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the route table. The name must be unique within the folder. Value must match the regular expression ` |
description | string Optional description of the route table. 0-256 characters long. |
labels | map<string,string> Resource labels, key:value pairs. No more than 64 per resource. The string length in characters for each key must be 1-63. Each value must match the regular expression [-_0-9a-z]* . Each key must match the regular expression [a-z][-_0-9a-z]* . |
network_id | string ID of the network the route table belongs to. |
static_routes[] | StaticRoute List of static routes. |
StaticRoute
Field | Description |
---|---|
destination | oneof: destination_prefix |
destination_prefix | string Destination subnet in CIDR notation |
next_hop | oneof: next_hop_address or gateway_id |
next_hop_address | string Next hop IP address |
gateway_id | string Next hop gateway id |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
ListOperations
Lists operations for the specified network.
rpc ListOperations (ListNetworkOperationsRequest) returns (ListNetworkOperationsResponse)
ListNetworkOperationsRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network 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 ListNetworkOperationsResponse.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 ListNetworkOperationsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
ListNetworkOperationsResponse
Field | Description |
---|---|
operations[] | operation.Operation List of operations for the specified network. |
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 ListNetworkOperationsRequest.page_size, use the next_page_token as the value for the ListNetworkOperationsRequest.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 |
Move
Move network to another folder.
rpc Move (MoveNetworkRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:MoveNetworkMetadata
Operation.response:Network
MoveNetworkRequest
Field | Description |
---|---|
network_id | string Required. ID of the Network 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 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 if operation finished successfully. |
MoveNetworkMetadata
Field | Description |
---|---|
network_id | string ID of the network that is being moved. |
Network
Field | Description |
---|---|
id | string ID of the network. |
folder_id | string ID of the folder that the network belongs to. |
created_at | google.protobuf.Timestamp Creation timestamp in RFC3339 |
name | string Name of the network. The name is unique within the folder. Value must match the regular expression |[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])? . |
description | string Optional description of the network. 0-256 characters long. |
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]* . |
default_security_group_id | string ID of default security group for network. |