Create A Network

Use this API call to create a SDN network.

Requires the sdn-networks-manage permission.

query
  • include

    Accepted Values: creatorsenvironments

  • sort

    Sorts can be performed on any field - see sorting

  • filter

    Collections of resources can be filtered based on certain criteria - see filtering 

Arguments
  • name
    string

    A name for the network.

  • identifier
    string

    A network identifier that will be used to signify container communications over this network.

  • cluster
    string

    A network will only create a connection between containers in environments which have the same cluster. This is the cluster selected for this network.

  • environments
    array of strings

    An array of environment names that are connected via this network.

Returns

Returns a network resource (the one you just created), otherwise returns an Error.

PATCH /v1/sdn/networks

Example Request
$ curl https://api.cycle.io/v1/sdn/networks/ \
-H
"Authorization: Bearer API_KEY"
\
-H
"X-HUB-ID: HUB_ID"
\
-d {"value":{"name":"networkX","identifier":"networkx","cluster":"production","environments":["App One","App Two "]}} \
-X PATCH
Example Response
{
"data": {
"id": "5a98710df231a500017f9aa4",
"name": "Test",
"identifier": "test",
"cluster": "production",
"creator": {
"type": "account",
"id": "3a78910df231a500017f9bb4"
},
"hub_id": "5cc78aa0db2ab000014a8b98",
"state": {
"changed": "2018-09-14T21:39:29.428Z",
"current": "live"
},
"private_network": {
"vxlan_tag": 25564,
"subnet": "a325",
"mac_addr_suffix": 233,
"ipv6": {
"ip": "fdoo:feee:b870::",
"cidr": "fdoo:feee:b870::/64"
}
},
"environments": [
{
"id": "3a78910df231a500017f9bb4",
"added": "2018-10-12T21:43:42.557Z"
}
],
"events": {
"created": "2018-09-14T21:39:03.096Z",
"updated": "2018-09-17T16:50:54.107Z",
"deleted": "0001-01-01T00:00:00Z"
}
}
}