Import Policies File

post

/mobile/tools/1.0/policies/import

Imports the environment policies in the uploaded file.

Request

Supported Media Types
Form Parameters
  • The description of the policies that are in the file.
  • The file with the environment policies to upload.
  • Set to `true` to overwrite any existing policy of the same name. When this attribute is set to `false`, a policy in the uploaded file is ignored if that policy already exists.
    Default Value: true
  • Set to `true` to delete all existing environment policies before upload.
    Default Value: false

Response

Supported Media Types

200 Response

The upload was successful. The validation report was returned in the response.
Body ()
The result of validation of the properties file with policies.
Root Schema : policyValidationReport
Type: object
The result of validation of the properties file with policies.
Show Source
Nested Schema : validationResults
Type: array
Minimum Number of Items: 0
Show Source

400 Response

The properties file was either missing, empty, or corrupted, or it had an invalid format. The validation report might be returned in the response.
Body ()
Root Schema : error
Type: object
Show Source
Nested Schema : errorDetails
Type: object
Show Source

Examples

The following example shows how to upload a policies file using cURL. For more information about cURL, see Use cURL.

curl -i -X POST --form desc="version 5.0" --form file=@policies.properties -H "Authorization: Bearer $TOKEN" "$BASE_URL/mobile/tools/1.0/policies/import"

Example of File to Upload

The file must be in the properties format, which is a list of key/value pairs. You typically use an exported policies file as the template for this file, as shown in this example:

# ---------------------------------------------------------
# MCS Policies.
# ---------------------------------------------------------
# ! DO NOT EDIT THE HEADER !
# Snapshot from: instance1
# System version: 17.3.1.0.0.170706.0620
# Data format: 2
# ---------------------------------------------------------
*.*.Admin_DcsConfig={}
*.*.Admin_FeatureConfiguration={ "DCS"\: true }
*.*.Asset_AllowPurge=ALL
*.*.Asset_AllowTrash=ALL
*.*.Asset_AllowUntrash=ALL
*.*.Asset_DefaultInitialVersion=1.0
...

Example of Response Header

The following shows an example of the response headers:

200 OK
Date: Wed, 28 Jun 2017 20:00:11 GMT
Content-length: 37
Content-type: application/json

Example of Response Body

The following example shows the contents of the response body in JSON format:

{"valid":true,"validationResults":[]}