...
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/intent-group
POST BODY:
{
"intent-group-name": "intent-group-1",
"description": "Intent Group for Customer1",
"group": [[
{
"generic":"xyz-generic-placement-intent"
},
{
"xyz-hpa-intent", :"xyz-connectivityhpa-intent"]
}
RETURN STATUS: },
{
"traffic":"xyz-traffic-intent"
}
]
}
RETURN STATUS: 201
RETURN BODY:
{
"intent-name": "intent-group-1",
"description": "Intent Group for Customer1"
} |
...
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/intent-group/{intent-group-name}
RETURN STATUS: 200
RETURN BODY:
{
"intent-group-name":"intent-group-1",
"description":"Intent Group for Customer1",
"group":[
"xyz-generic-placement-intent",{
"generic":"xyz-generic-hpaplacement-intent"
},
{
"hpa":"xyz-connectivityhpa-intent"
]
}
DELETE
URL: /v2/intent-group/{intent-group-name}
RETURN STATUS: ,
{
"traffic":"xyz-traffic-intent"
}
]
}
DELETE
URL: /v2/intent-group/{intent-group-name}
RETURN STATUS: 204
|
Generic Placement Intent API
...
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/generic-placement-intentintent/placement/generic
POST BODY:
{
"intent-name":"intent-1",
"description":"Intent-1 for Customer1",
"applications":[
{
"name":"app1",
"anyOf":[
{
"edge1",
"edge2cluster-name":"edge1"
]},
},
{
"cluster-name":"app2edge2",
"allOf":[
}
]
"edge1"},
{
"edge2name":"app2",
]
"allOf":[
},
{
"cluster-name":"app3edge1",
"allOf":[
},
{
"edge1",
"cluster-name":"edge2",
{}
]
},
"anyOf":[
{
"name":"app3",
"east-us1",
allOf":[
{
"east-us2 "cluster-name":"edge1"
},
]
{
}
]"cluster-name":"edge2"
},
]
}
RETURN STATUS: 201
RETURN BODY:
{
"intent-name": "intent-1",
"description": "Intent-1 for Customer1"
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/generic-placement-intent/{intent-name}
RETURN STATUS: 200
RETURN BODY:
{
"intent-name":"intent-1",
"description":"Intent-1 for Customer1",
"applications":[
{
"anyOf":[
{
"label-name":"east-us1"
},
{
{
"label-name":"app1east-us2",
"anyOf":[
}
"edge1",
]
"edge2"
]}
}, ]
{}
]
}
RETURN STATUS: 201
RETURN BODY:
{
"intent-name": "app2intent-1",
"allOfdescription":[
"Intent-1 for Customer1"
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/intent/placement/generic/{intent-name}
RETURN STATUS: 200
RETURN BODY:
{
"intent-name":"intent-1",
"description":"Intent-1 for Customer1",
"applications":[
"edge1",
"edge2"
]
},
{
"name":"app3app1",
"allOfanyOf":[
{
"cluster-name":"edge1",
"edge2"},
{
"anyOfcluster-name":["edge2"
}
"east-us1",]
},
{
"east-us2"name":"app2",
"allOf":[
]
{
}"cluster-name":"edge1"
]
},
} {
]
}
DELETE
URL: /v2/generic-placement-intent/{intent-name}
RETURN STATUS: 204
|
Instantiation API
"cluster-name":"edge2"
}
]
},
{
"name":"app3",
"allOf":[
{
"cluster-name":"edge1"
},
{
"cluster-name":"edge2"
},
{
"anyOf":[
{
"label-name":"east-us1"
},
{
"label-name":"east-us2"
}
]
}
]
}
]
}
DELETE
URL: /v2/intent/placement/generic/{intent-name}
RETURN STATUS: 204
|
Instantiation API
Instantiation API Instantiation API is now based on the Profile API instead of having its own URL root.
...
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/cloudcluster-registration
POST BODY:
{
“cloud-region” : “<name>”, // Must be unique across
“cloud-owner” : “<owner>”,
“other-connectivity-list”
}
RETURN STATUS: {
//Extendible list of name value pairs
“connectivity-records” : [
{
“connectivity-record-name”201
RETURN BODY:
{
“cloud-region” : “<name>”,
“FQDN-or-ip” : “<fqdn>”,
“ca-cert-to-verify-server” : “<contents of CA certificate>”,
“ssl-initiator” : “<true/false”>,
“user-name”: “<user name>”, //valid if ssl-initator is false
“password” : “<password>”, // valid if ssl-initiator is false
“private-key” : “<contents of private key in PEM>”, // valid if ssl-initiator is true
“cert-to-present” : “<contents of certificate to present to server>” , //valid if ssl-initiator is true
“labels” : ["hpa-feature1", "hpa-feature2", "us-east-coast"]
},
]
}
} // Must be unique
“cloud-owner” : “<owner>”,
} |
This is a multipart upload and here is how you do the POST for this.
#Using a json file containing content as above;
curl -i -F "metadata=<jsonfile;type=application/json" -F file=@/home/user/.kube/config -X POST http: // NODE_IP:PORT/v2/cluster-registration
|
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-registration/{cloud-region-name}
RETURN STATUS: 200
RETURN BODY:
{
“cloud-region” : “<name>”, // Must be unique across
“cloud-owner” : “<owner>”,
}
DELETE
URL: /v2/cluster-registeration/{cloud-region-name}
RETURN STATUS: 204
|
Add Label to a cluster
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/cluster-registration/{cloud-region-name}/label
POST BODY:
{
“label-name” : “<label>”
}
RETURN STATUS: 201
RETURN BODY:
{
“label-name” : “<label>”
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-registration/{cloud-region-name}/label/<label>
RETURN STATUS: 201200
RETURN BODY:
{
“label-name” “cloud-region” : “<name>”, // Must be unique across
“cloud-owner” : “<owner>”,
} |
...
: “<label>”
}
DELETE
URL: /v2/cluster-registeration/{cloud-region-name}/label/<label>
RETURN STATUS: 204
|
Add key-value pair to a cluster
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cloudcluster-registration/{cloud-region-name}/kv-pair
POST BODY:
{
"kv":[
{
"key1":"val1"
},
{
"key2":"val2"
}
]
}
RETURN STATUS: 201
RETURN BODY:
{
"kv":[
{
"key1":"val1"
},
{
"key2":"val2"
}
]
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-registration/{cloud-region-name}/kv-pair/<key>
RETURN STATUS: 200
RETURN BODY:
{
"key1":"val1"
RETURN STATUS: 200
RETURN BODY:
{
“cloud-region” : “<name>”, // Must be unique across
“cloud-owner” : “<owner>”,
“other-connectivity-list” : {
//Extendible list of name value pairs
“connectivity-records” : [
{
“connectivity-record-name” : “<name>”,
“FQDN-or-ip” : “<fqdn>”,
“ca-cert-to-verify-server” : “<contents of CA certificate>”,
“ssl-initiator” : “<true/false”>,
“user-name”: “<user name>”, //valid if ssl-initator is false
“password” : “<password>”, // valid if ssl-initiator is false
“private-key” : “<contents of private key in PEM>”, // valid if ssl-initiator is true
“cert-to-present” : “<contents of certificate to present to server>” , //valid if ssl-initiator is true
“labels” : ["hpa-feature1", "hpa-feature2", "us-east-coast"]
},
]
}
}
DELETE
URL: /v2/cloudcluster-registeration/{cloud-region-name}/kv-pair/<key>
RETURN STATUS: 204
|