POST /api/deployment/group/configuration/file/environment/{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 2.

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 POST /api/deployment/group/configuration/file/policy/{groupID}. 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 the method described here. 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/environment/{groupID}?relatedPolicyArchiveID={policyArchiveID}


Parameters

groupID mandatory The id of the group that the merged Deployment Archive is destined for.
relatedPolicyArchiveID mandatory The id of the Policy Archive uploaded in Step 1 that must be merged with the Environment Archive uploaded via this method.
environmentFile mandatory The Environment 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 Environment Archive to the Admin Node Manager, merge with related Policy Archive, and replication of merged Deployment Archive across hosts. The response body contains the id of the merged Deployment Archive.
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/environment/group-2?relatedPolicyArchiveID=9124ef94-0b18-4b67-b9f0-ece0c653ca36

Content-Type: multipart/form-data

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

<binary data>

--Boundary_1_16329281_1355225008368--

HTTP 1.1 200 OK

{
    "result": "87f80129-f06e-4a3f-8931-38eeb12bf217"
}