Usage¶
An API HTTP REST is implemented to manage the communication and the work of the Dynamic Policy Manager.
All URIs are relative to http://localhost:8080/api/v1.
Mainly the Dynamic Policy Manager use in the first version the method get for to return one or all policies created, and post to create a new policies.
API calls for the DPM¶
Several API endpoints are provided in this component, as shown in the following. For a full definition of the URL and the schema on this REST calls see the Annexes documentation.
| HTTP Request | Description | 
| GET/policies/{id} | Get a policy id | 
| GET/policies/ | Return the list of policies created/updated | 
| POST/policies/ | Add new policy | 
| GET/policies/status | Read items | 
| POST/alertmanager/ | AlertManager Webhooks | 
| POST/registry/icos | ICOS Process App descriptor | 
Endpoints¶
GET/registry/api/v1/policies/{id}¶
- Parameters: an authorization access token is requested as String
 - Request body is provided from the following schema;
 
| AttributeName | Type | Description | 
| id | Long | Unique identifier of the deployment | 
GET /registry/api/v1/policies/¶
- Parameters: an authorization access token is requested as String.
 - No schema is provided.
 
POST/registry/ap1/v1/policies/{policy}¶
- Parameters: an authorization access token is requested as String.
 - Request body is provided from the following schema;
 
| AttributeName | Type | Description | 
| subject | Subject[] | Provides a set of information about the type of  application, name of the application, component and instance  | 
| spec | Spec[] | Set of information about the template used | 
| action | Action[] | Set of information about the action to provided. [DEFAULT] is “webhook”.  | 
| variables | Variables[] | [OPTIONAL] addtional properties. It can a string, an integer or a number. [DEFAULT] is {}.  | 
| properties | Properties[] | [OPTIONAL] additional properties [DEFAULT] is {}. | 
Subject[]
| AttributeName | Type | Description | 
| type | const | Default is "app"  Name of app  | 
appName | String | Name of app | 
| appComponent | String | Component of app | 
| appInstance | String | Instance of app | 
Spec[]
| AttributeName | Type | Description | 
| type description  | 
String | [DEFAULT] is empty “” | 
| type | Const | [DEFAULT] is “template” | 
| templateName | String | Name of template | 
Http methods from the following RFCs are all observed:
- RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
 - RFC 5789: PATCH Method for HTTP
 
Allowed values are : CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST,PUT, TRACE.
Variables[]
| AttributeName | Type | Description | 
| #0 | String | [OPTIONAL] | 
| #1 | integer | [OPTIONAL] | 
| #2 | number | [OPTIONAL] | 
Properties[]
| AttributeName | Type | Description | 
| oneoff | boolean | boolean | 
| interval | String | Interval where the policy should be acts | 
| pendingInterval | String | Information about the interval status | 
Reference¶
Designed and architecture refer to the deliverable D3.1 Meta-kernel Layer Module Developed (IT-1) provides about the implementation. API models and how to work refer to the deliverable D3.2 Metakernel Layer Module Develope (IT-2)