Creating Network Resources
Function
This API is used to create network resources.
URI
POST /v1/{project_id}/networks
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
apiVersion |
Yes |
String |
API version. Options:
|
kind |
Yes |
String |
Resource type. Options:
|
metadata |
Yes |
NetworkMetadataCreation object |
Metadata of network resources. |
spec |
Yes |
NetworkSpec object |
Description of network resources. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
labels |
Yes |
NetworkMetadataLabels object |
Metadata labels of network resources. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
os.modelarts/name |
Yes |
String |
Specified network name. Minimum: 4 Maximum: 32 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
ipv6enable |
No |
Boolean |
Whether to enable IPv6. Once IPv6 is enabled, it cannot be disabled. |
cidr |
Yes |
String |
Network CIDR. Value range:
|
connection |
No |
NetworkConnection object |
Automatically interconnected endpoint. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
peerConnectionList |
No |
Array of peerConnectionList objects |
Peering connections |
sfsTurboConnectionList |
No |
Array of sfsTurboConnectionList objects |
SFS Turbo connections through attached NICs |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options:
|
kind |
String |
Resource type. Options:
|
metadata |
NeworkMetadata object |
Metadata of network resources. |
spec |
NetworkSpec object |
Description of network resources. |
status |
NetworkStatus object |
Status of network resources. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Automatically generated network name, which is equivalent to networkId. |
creationTimestamp |
String |
Timestamp, for example, 2021-11-01T03:49:41Z. |
labels |
NetworkMetadataLabels object |
Labels of network resources. |
annotations |
NetworkMetadataAnnotations object |
Annotations of network resources. |
Parameter |
Type |
Description |
---|---|---|
os.modelarts/name |
String |
Specified network name. Minimum: 4 Maximum: 32 |
Parameter |
Type |
Description |
---|---|---|
os.modelarts/description |
String |
Network resource description, which is used to describe a scenario. The following special characters are not allowed: !<>=&"' Minimum: 0 Maximum: 100 |
Parameter |
Type |
Description |
---|---|---|
ipv6enable |
Boolean |
Whether to enable IPv6. Once IPv6 is enabled, it cannot be disabled. |
cidr |
String |
Network CIDR. Value range:
|
connection |
NetworkConnection object |
Automatically interconnected endpoint. |
Parameter |
Type |
Description |
---|---|---|
peerConnectionList |
Array of peerConnectionList objects |
Peering connections |
sfsTurboConnectionList |
Array of sfsTurboConnectionList objects |
SFS Turbo connections through attached NICs |
Parameter |
Type |
Description |
---|---|---|
peerVpcId |
String |
VPC ID of the peer end |
peerSubnetId |
String |
Subnet ID of the peer end |
Parameter |
Type |
Description |
---|---|---|
sfsId |
String |
ID of an SFS Turbo instance |
name |
String |
Name of an SFS Turbo instance |
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Current network status. Options:
|
connectionStatus |
NetworkConnectionStatus object |
Network connection status. |
Parameter |
Type |
Description |
---|---|---|
peerConnectionStatus |
Array of peerConnectionStatus objects |
Peering connection status |
sfsTurboStatus |
Array of sfsTurboStatus objects |
Status of SFS Turbo accessible to the network |
Parameter |
Type |
Description |
---|---|---|
peerVpcId |
String |
VPC ID of the peer end |
peerSubnetId |
String |
Subnet ID of the peer end |
phase |
String |
Network connection status. Options:
|
Parameter |
Type |
Description |
---|---|---|
sfsId |
String |
SFS Turbo ID |
name |
String |
SFS Turbo name |
status |
String |
Status of the connection to SFS Turbo. Options:
|
ipAddr |
String |
SFS Turbo access address |
connectionType |
String |
Connection type. Options:
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
Create a network.
POST {endpoint}/v2/{project_id}/pools { "apiVersion" : "v1", "kind" : "Network", "metadata" : { "labels" : { "os.modelarts/name" : "network-7a03", "os.modelarts/workspace.id" : "0" } }, "spec" : { "cidr" : "192.168.128.0/17" } }
Example Responses
Status code: 200
OK
{ "kind" : "Network", "apiVersion" : "v1", "metadata" : { "name" : "network-7a03-86c13962597848eeb29c5861153a391f", "creationTimestamp" : "2022-09-16T09:44:59Z", "labels" : { "os.modelarts/name" : "network-7a03", "os.modelarts/workspace.id" : "0" }, "annotations" : { } }, "spec" : { "cidr" : "192.168.128.0/17", "connection" : { } }, "status" : { "phase" : "" } }
Status code: 400
Bad request.
{ "error_code" : "ModelArts.50004000", "error_msg" : "Bad request." }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad request. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.