POST /api/deployment/group/configuration/file/policy/{groupID}

Description

A client application may need to deploy a separate Policy Archive (.pol) and Environment Archive (.env) to a group of API Servers, e.g. a web-based application, as it cannot merge the .pol and .env to create a Deployment Archve (.fed) locally. For a .pol and .env deployment, the API method described here must be invoked as Step 1.

The steps for deployment of a Policy Archive (.pol) and Environment Archive (.env) to a group of API Servers, (when the client application cannot merge the .pol and .env to create a .fed), are as follows:-

Step 1: Upload the Policy Archive by invoking the method described here. The Node Manager copies the Policy Archive to its local disk. This method returns the id of the Policy Archive to the client application. The policy archive id must be passed in Step 2 of the .pol and .env deployment as the query string parameter relatedPolicyArchiveID.

Step 2: Upload the Environment Archive, by invoking POST /api/deployment/group/configuration/file/environment/{groupID}. The Node Manager creates a merged Deployment Archive and replicates it to all hosts running API Servers in the group. This method returns the id of the Deployment Archive to the client application. The Deployment Archive id must be passed in Step 3 of the .pol and .env deployment.

Step 3: Invoke the Configuration API method PUT /api/configuration?archiveId={archiveId} on each API Server in the group via the Routing API in the Node Manager to get the API Server to load the new configuration.


Resource URL

https://localhost:8090/api/deployment/group/configuration/file/policy/{groupID}


Parameters

groupID mandatory The id of the group that this Policy Archive is destined for.
policyFile mandatory The Policy Archive file. This is passed in the request body as multipart/form-data.

Response Codes

Response Code Description
200 Success. Indicates a successful upload of the Policy Archive to the Admin Node Manager. The response body contains the id of the Policy Archive as this will not be visible to the client application.
500 The response contains an error e.g. a failure occurred writing to disk.

Example Request and Response

POST https://localhost:8090/api/deployment/group/configuration/file/policy/group-2

Content-Type: multipart/form-data

--Boundary_1_16329281_1355225008368
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="policy.pol"; modification-date="Mon, 10 Dec 2012 09:40:15 GMT"; size=222969; name="policyFile"

<binary data>

--Boundary_1_16329281_1355225008368--

HTTP 1.1 200 OK

{
    "result": "9124ef94-0b18-4b67-b9f0-ece0c653ca36"
}