Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleGET, DELETE
linenumberstrue
GET
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}

RETURN STATUS: 200
RETURN BODY: 
{  
  "rb-name": "test-rbdef",
  "rb-version": "v1", 
  "profile-name": "test-rbdef",
  "namespace": "v1",
  "description": "testing resource bundle definition api"
}

DELETE
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}

RETURN STATUS: 204

Intent Group API

Intent Group API is different compared to the other APIs documented here.There is a main Intent API that allows you to create a Parent Intent and any SUB Intents are forwarded to their respective handlersused to create Intent Groups that can then will be used at instantiation time. Some intents that can be part of an Intent Group are Generic Placement Intent, HPA Intent, and Connectivity Intent.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/project/{project-name}/rb/{rb-name}/{version}/intentintent-group
POST BODY:
{
    "intent-group-name": "testintent-group-rbdef1",
    "description": "testingIntent resourceGroup bundlefor definition apiCustomer1",
}

RETURN STATUS: 201
RETURN BODY: 
{ 
  "intent    "group": ["xyz-generic-placement-intent", "xyz-hpa-intent", "xyz-connectivity-intent"]
}

RETURN STATUS: 201
RETURN BODY: 
{ 
  "intent-name": "testintent-group-rbdef1",
  "description": "testingIntent resourceGroup bundlefor definition apiCustomer1"
}

GET, DELETE

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/project/{project-name}/rbintent-group/{rb-name}/{version}/intent/{intentintent-group-name}

RETURN STATUS: 200
RETURN BODY: 
{
 
  "intent-group-name": "testintent-group-rbdef1",
   "description":"Intent Group for Customer1"testing,
 resource bundle definition api"
}

"group":[
      "xyz-generic-placement-intent",
      "xyz-hpa-intent",
      "xyz-connectivity-intent"
   ]
}

DELETE
URL: /v2/projectintent-group/{project-name}/rb/{rb-name}/{version}/intent/{intent-name}intent-group-name}

RETURN STATUS: 204

...


Generic Placement Intent API

...

Generic Placement Intent API is used to create generic placement intents for sub-applications in an application and will be added to an Intent Group.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/project/{project-name}/rb/{rb-name}/{version}/intent/{intent-name}/{sub-intent}/...The remaining URL is forwarded to the POST Handler of the Sub Intent AdapterPOST BODY:
{
 // Defined by the sub intent and forwarded to and handled by it
}

RETURN STATUS: 201
RETURN BODY: 
{ 
  // Defined by the sub intent and handled by it
}
Code Block
languagec#
titleCode Fragment
linenumberstrue
router.HandleFunc("/{pr-name}/rb/{rb-name}/{rb-version}/intent/{intent-name}/{sub-intent-name}", adapterMgr.GetAdapter(sub-intent-name).HandlePost).Methods("POST")
router.HandleFunc(`/{pr-name}/rb/{rb-name}/{rb-version}/intent/{intent-name}/{sub-intent-name}/{rest:[a-zA-Z0-9=\-\/]+}`, adapterMgr.GetAdapter(sub-intent-name).HandlePost).Methods("POST")

//HandlePost will then figure out if it needs the “rest” or just r.body is enough.
//json.Unmarshal will happen in the HandlePost preventing any map[string]interface{} casts.

GET, DELETE

generic-placement-intent
POST BODY:
{
   "intent-name":"intent-1",
   "description":"Intent-1 for Customer1",
   "applications":[
      {
         "name":"app1",
         "anyOf":[
            "edge1",
            "edge2"
         ]
      },
      {
         "name":"app2",
         "allOf":[
            "edge1",
            "edge2"
         ]
      },
      {
         "name":"app3",
         "allOf":[
            "edge1",
            "edge2",
            {
               "anyOf":[
                  "east-us1",
                  "east-us2"
               ]
            }
         ]
      }
   ]
}

RETURN STATUS: 201
RETURN BODY: 
{ 
  "intent-name": "intent-1",
  "description": "Intent-1 for Customer1"
}

GET, DELETE

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/generic-placement-intent/{intent-name}

RETURN STATUS: 200
RETURN BODY: 
{
   "intent-name":"intent-1",
   "description":"Intent-1 for Customer1",
   "applications":[
      {
         "name":"app1",
         "anyOf":[
            "edge1",
            "edge2"
         ]
      },
      {
         "name":"app2",
         "allOf":[
            "edge1",
            "edge2"
         ]
      },
      {
         "name":"app3",
         "allOf":[
            "edge1",
            "edge2",
            {
               "anyOf":[
                  "east-us1",
                  "east-us2"
               ]
            }
         ]
      }
   ]
}

DELETE
URL: /v2/generic-placement-intent/{intent-name}

RETURN STATUS: 204

Instantiation API

Instantiation API is now based on the Profile API instead of having its own URL root.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}/instance
POST BODY:
{
	"logical-cloud": "logical-cloud-name" //name of logical cloud to use for instantiation. The DCM API will provide the list of clusters that are part of the logical-cloud
	"intent-group": "intent-group-name", //name of intent-group to use for collecting intents which will be used during instantiation
	//override-values overrides values from the helm charts and allows for instantiation time
    //variable overrides.
    "override-values": {
		imageRepository: "registry.hub.docker.com"
	}
}

RETURN STATUS: 201
RETURN BODY: 
{  
  "id": "laughing_robinson",
  "rb-name": "test-rbdef",
  "rb-version": "v1", 
  "profile-name": "test-rbdef",
  "cloudRegion": "kud",
  "namespace": "testinstallns",
  "resources": [
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo"
    },
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo-read"
    }
  ]
}

GET, DELETE

Code Block
languagejs
titleGET, DELETE
linenumberstrue
GET
Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/project/{project-name}/rb/{rb-name}/{version}/intent/{intent-name}/{sub-intent}/...

RETURN STATUS: 200
RETURN BODY: 
{
  // Defined by the sub intent and handled by it
}

DELETE
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/intentprofile/{intentprofile-name}/{sub-intent}

RETURN STATUS: 204

Instantiation API

Instantiation API is now based on the Profile API instead of having its own URL root.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}/instance
POST BODY:
{
	"logical-cloud": "logical-cloud-name" //name of logical cloud to use for instantiation. The DCM API will provide the list of clusters that are part of the logical-cloud
	"intent-group": "intent-group-name", //name of intent-group to use for collecting intents which will be used during instantiation
	//override-values overrides values from the helm charts and allows for instantiation time
    //variable overrides.
    "override-values": {
		imageRepository: "registry.hub.docker.com"
	}
}

RETURN STATUS: 201
RETURN BODY: 
{  
  "id": "laughing_robinson",
  "rb-name": "test-rbdef",
  "rb-version": "v1", 
  "profile-name": "test-rbdef",
  "cloudRegion": "kud",
  "namespace": "testinstallns",
  "resources": [
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo"
    },
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo-read"
    }
  ]
}

GET, DELETE

instance/{instance-id}

RETURN STATUS: 200
RETURN BODY: 
{  
  "id": "laughing_robinson",
  "rb-name": "test-rbdef",
  "rb-version": "v1", 
  "profile-name": "test-rbdef",
  "cloudRegion": "kud",
  "namespace": "testinstallns",
  "resources": [
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo"
    },
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo-read"
    }
  ]
}

DELETE
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}/instance/{instance-id}

RETURN STATUS: 204


Cluster Registration API

API to support Reachability for Kubernetes Cloud


Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/cloud-registeration
POST 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"]
                          
            },
         ]
    }
}

RETURN STATUS: 201
RETURN BODY: 
{ 
    “cloud-region” : “<name>”,   // Must be unique across
    “cloud-owner” :  “<owner>”,
}

GET, DELETE

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/cloud-registeration/{cloud-region-name}

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/cloud-registeration/{cloud-region-name}

RETURN STATUS: 204

Code Block
languagejs
titleGET, DELETE
linenumberstrue
GET
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}/instance/{instance-id}

RETURN STATUS: 200
RETURN BODY: 
{  
  "id": "laughing_robinson",
  "rb-name": "test-rbdef",
  "rb-version": "v1", 
  "profile-name": "test-rbdef",
  "cloudRegion": "kud",
  "namespace": "testinstallns",
  "resources": [
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo"
    },
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "Name": "mongo-read"
    }
  ]
}

DELETE
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}/instance/{instance-id}

RETURN STATUS: 204