Deployment Manager

This section describes the following Deployment Manager Procedures:

POST /executeQuery
POST /executeDDL
POST /executePlan
GET /export_dm_metadata
GET /export_plan_package
POST /import_dm_metadata
DELETE /purgeLog
GET /validateSite

POST /executeQuery

This API is used to execute query.

Parameters:

None

Request Body

Example Value - Schema

[
“query”: "string",
“standardSQL”: “string”
]

 

Example

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeQuery" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "query=select * from SYS_SITES&standardSql=true"

POST /executeDDL

This API is used to execute DDL commands.

Parameters:

None

Request Body

Example Value - Schema

[
"string"
]

Example to Create Site

curl -X POST  -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'CREATE RESOURCE /mySite OF TYPE "site" SET ANNOTATION "my site annotation" SET PROPERTIES { "host" : "localhost", "port": 9400, "user":"admin", "password":"password", "domain":"composite"}'

Example to Update Site

curl -X POST  -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'ALTER RESOURCE /mySite OF TYPE "site" SET ANNOTATION "my site annotation update "'

Example to Delete Site

curl -X POST  -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'DROP RESOURCE /mySite OF TYPE "site"'

Example to Create Resource Set

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'CREATE RESOURCE /mySite/myResourceSet OF TYPE "resource_set" SET ANNOTATION "my resource set annotation" SET PROPERTIES { "definition" : "{\""includeDependencies\"":\""true\"",\""resourceTrees\"":[{\""path\"":\""/shared\"",\""type\"":\""CONTAINER\""}]}"}' 

Example to Update Resource Set

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'ALTER RESOURCE /mySite/myResourceSet OF TYPE "resource_set" SET ANNOTATION "my resource set annotation update" ' 

Example to Delete Resource Set

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'DROP RESOURCE /mySite/myResourceSet OF TYPE "resource_set"' 

Example to Create Resource Set Mapping

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'CREATE RESOURCE /targetSite/sourceSite/shared/examples/ds_orders#DATA_SOURCE OF TYPE "attribute_mapping" SET PROPERTIES { "definition" : { "urlPort" : "1000"}}' 

Example to Update Resource Set Mapping

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'ALTER RESOURCE /targetSite/sourceSite/shared/examples/ds_orders#DATA_SOURCE OF TYPE "attribute_mapping" SET PROPERTIES { "definition" : { "urlPort" : "2000"}}' 

Example to Delete Resource Set Mapping

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'DROP RESOURCE /targetSite/sourceSite/shared/examples/ds_orders#DATA_SOURCE OF TYPE "attribute_mapping"' 

Example to Create Principal Set

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'CREATE RESOURCE /mySourceSite/myPrincipalSet OF TYPE "principal_set" SET PROPERTIES { "definition" : [ "/composite/user/dev"] }'

Example to Update Principal Set

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'ALTER RESOURCE /mySourceSite/myPrincipalSet OF TYPE "principal_set" SET ANNOTATION "my principal set annotation update"'

Example to Delete Principal Set

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'DROP RESOURCE /mySourceSite/myPrincipalSet OF TYPE "principal_set"'

Example to Create Principal Set Mapping

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'CREATE RESOURCE /myTargetSite/mySourceSite OF TYPE "principal_set_mapping" SET PROPERTIES { "definition" : { "/composite/user/dev" : "/composite/user/test"}}'

Example to Update Principal Set Mapping

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'ALTER RESOURCE /myTargetSite/mySourceSite OF TYPE "principal_set_mapping" SET PROPERTIES { "definition" : { "/composite/user/dev" : "/composite/user/dev1"}}'

Example to Delete Principal Set Mapping

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'DROP RESOURCE /myTargetSite/mySourceSite OF TYPE "principal_set_mapping"'

Example to Create Deployment Plan

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'CREATE RESOURCE /myTargetSite/mySourceSite/MyDeploymentPlan_PrincipalSet_ADD OF TYPE "deployment_plan" SET ANNOTATION "my deployment plan annotation" SET PROPERTIES { "definition" : "{\""operations\"":{\""principalSet\"":\""myPrincipalSet\"",\""targetOperation\"":\""ADD\""}}"}'

Example to Update Deployment Plan

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'ALTER RESOURCE /myTargetSite/mySourceSite/MyDeploymentPlan_PrincipalSet_ADD OF TYPE "deployment_plan"'

Example to Delete Deployment Plan

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executeDDL" -H "Content-Type:text/plain" -H "Accept:text/plain" -d 'DROP RESOURCE /myTargetSite/mySourceSite/MyDeploymentPlan_PrincipalSet_ADD OF TYPE "deployment_plan"'

POST /executePlan

This API is used to execute Deployment Plan.

Parameters:

None

Request Body

Example Value - Schema

[
"string"
]

Example

curl -X POST -u admin:admin "http://localhost:9400/rest/deploy/executePlan" -d '/myTargetSite/mySourceSite/DeploymentPlanName'

GET /export_dm_metadata

This API is used to export Deployment Management Artifacts.

Parameters:

Name

Description

Parameter Type

Data Type

encryptionPassword

Encryption password

query

string

Example

curl -X GET -u admin:admin "http://localhost:9400/rest/deploy/export_dm_metadata" -H "Content-Type:application/binary"

GET /export_plan_package

This API is used to export Deployment Plan.

Parameters:

Name

Description

Parameter Type

Data Type

plan

The plan name that will be exported

query

string

encryptionPassword

Encryption password

query

string

Example

curl -X GET -u admin:admin "http://localhost:9400/rest/deploy/export_plan_package?plan=planName" -H "Content-Type:application/binary"

POST /import_dm_metadata

This API is used to import Deployment Management Artifacts.

Parameters

 

Name

Description

Parameter Type

Data Type

file

The name of the file to be imported.

query

object

overwrite

Option to indicate whether to overwrite.

query

boolean

encryptionPassword

Encryption Password

query

string

ignoreEncryption

Option to indicate whether to ignore encryption errors.

query

boolean

Note: If the option ignoreEncryption is used, then all backup data will be imported regardless of whether a valid encryption key was provided. This means that the import will not fail. This option can be used to allow partially importing any backed up data. However, the import process will only import data that is not encrypted or can be decrypted using the provided encryption key. All encrypted portions of the backup data that cannot be decrypted will be imported as empty values and the import will otherwise succeed.

This affects all encrypted values in the backup data, which includes, but is not limited to data source and LDAP domain connection passwords.

Example

curl -X POST -u admin:admin  "http://localhost:9400/rest/deploy/import_dm_metadata" -H "Content-Type:multipart/form-data" -v -F 'file=@localfilename' -F “ignoreEncryption=true” -X 'overwrite=true/false'

DELETE /purgeLog

This API is used to purge Deployment Logs.

Parameters

 

Name

Description

Parameter Type

Data Type

ids

The plan ids

query

string

begin

The log begin time

query

string

end

The log end time

query

string

Example

curl -X DELETE -u admin:admin "http://localhost:9400/rest/deploy/purgeLog" -H "begin:0" -H "end:2408386295553"

GET /validateSite

This API is used to validate Site Information.

Parameters:

Name

Description

Parameter Type

Data Type

siteName

Name of the site

query

string

Example

curl -X GET -u admin:admin "http://localhost:9400/rest/deploy/validateSite?siteName=sourceSite"