Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lai, Weijian <laiweijian4@huawei.com> Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
42 KiB
Updating a Network Resource
Function
This API is used to update a specified network resource.
Debugging
You can debug this API through automatic authentication in or use the SDK sample code generated by API Explorer.
URI
PATCH /v1/{project_id}/networks/{network_name}
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
network_name |
Yes |
String |
Network resource name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
Content-Type |
Yes |
String |
Application/merge-patch + JSON. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
metadata |
No |
NetworkMetadataUpdate object |
Updated network resource metadata. |
spec |
No |
NetworkSpecUpdate object |
Updated network resource description. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
annotations |
No |
NetworkMetadataAnnotations object |
Resource annotations. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
os.modelarts/description |
No |
String |
Network resource description, which is used to describe a scenario. The following special characters are not allowed: !<>=&"' |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
connection |
No |
NetworkConnection object |
Updated network connection. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
peerConnectionList |
No |
Array of peerConnectionList objects |
List of networks that can be connected in peer mode. |
sfsTurboConnectionList |
No |
Array of sfsTurboConnectionList objects |
Specifies the SFS Turbo list by attaching 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. |
Parameter |
Type |
Description |
|---|---|---|
os.modelarts/description |
String |
Network resource description, which is used to describe a scenario. The following special characters are not allowed: !<>=&"' |
Parameter |
Type |
Description |
|---|---|---|
cidr |
String |
Network CIDR. Value range:
|
connection |
NetworkConnection object |
Information about the connection between the current network and other cloud services. |
Parameter |
Type |
Description |
|---|---|---|
peerConnectionList |
Array of peerConnectionList objects |
List of networks that can be connected in peer mode. |
sfsTurboConnectionList |
Array of sfsTurboConnectionList objects |
Specifies the SFS Turbo list by attaching NICs. |
Parameter |
Type |
Description |
|---|---|---|
peerVpcId |
String |
Indicates the ID of the peer VPC. |
peerSubnetId |
String |
ID of the peer subnet. |
Parameter |
Type |
Description |
|---|---|---|
sfsId |
String |
Specifies the ID of an SFS Turbo instance. |
name |
String |
Name of the sfsTurbo instance. |
Parameter |
Type |
Description |
|---|---|---|
phase |
String |
Current network status. Options:
|
connectionStatus |
NetworkConnectionStatus object |
Indicates the connection status between the network and other cloud services. |
Parameter |
Type |
Description |
|---|---|---|
peerConnectionStatus |
Array of peerConnectionStatus objects |
Indicates the status information list of the network in peer mode. |
sfsTurboStatus |
Array of sfsTurboStatus objects |
Specifies the list of SFS Turbos that can be connected to the network. |
Parameter |
Type |
Description |
|---|---|---|
peerVpcId |
String |
Indicates the ID of the peer VPC. |
peerSubnetId |
String |
ID of the peer subnet. |
phase |
String |
Connection status of the network. The options are as follows:
|
Parameter |
Type |
Description |
|---|---|---|
sfsId |
String |
Specifies the SFS Turbo ID. |
name |
String |
Specifies the name of the SFS Turbo. |
status |
String |
Specifies the status of the connection to the SFS Turbo. The options are as follows:
|
ipAddr |
String |
Specifies the address for accessing SFS Turbo. |
connectionType |
String |
Association mode. The options are as follows:
|
Status code: 400
Parameter |
Type |
Description |
|---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 404
Parameter |
Type |
Description |
|---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
Interconnect with a VPC.
PATCH https://{endpoint}/v1/{project_id}/networks/{network_name}
{
"spec" : {
"connection" : {
"peerConnectionList" : [ {
"peerVpcId" : "03e4f4d7-fc62-409b-9c52-df885525e30b",
"peerSubnetId" : "42aeebc3-f7c7-45aa-b884-e6e9ac2f841d"
} ],
"sfsTurboConnectionList" : [ {
"sfsId" : "97beb2bb-1a5b-41dd-b7fb-65a9c7954517",
"name" : "mulVpc-02"
} ]
}
}
}
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" : {
"peerConnectionList" : [ {
"peerVpcId" : "03e4f4d7-fc62-409b-9c52-df885525e30b",
"peerSubnetId" : "42aeebc3-f7c7-45aa-b884-e6e9ac2f841d"
} ],
"sfsTurboConnectionList" : [ {
"sfsId" : "97beb2bb-1a5b-41dd-b7fb-65a9c7954517",
"name" : "mulVpc-02"
} ]
}
},
"status" : {
"phase" : "Active",
"connectionStatus" : { }
}
}
Status code: 400
Bad request
{
"error_code" : "ModelArts.50004000",
"error_msg" : "Bad request."
}
Status code: 404
Not found.
{
"error_code" : "ModelArts.50025001",
"error_msg" : "Network not exist."
}
Status Codes
Status Code |
Description |
|---|---|
200 |
OK |
400 |
Bad request |
404 |
Not found. |
Error Codes
See Error Codes.