Import Policies File
post
/mobile/tools/1.0/policies/import
Imports the environment policies in the uploaded file.
Request
Supported Media Types
- multipart/form-data
Form Parameters
- desc
-
Type:
stringThe description of the policies that are in the file. - file
-
Type:
fileRequired:trueThe file with the environment policies to upload. - overwrite
-
Type:
booleanSet 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.true - purge
-
Type:
booleanSet to `true` to delete all existing environment policies before upload.false
Response
Supported Media Types
- application/json
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:
objectThe result of validation of the properties file with policies.
- valid
-
Type:
booleanRequired:true - validationResults
-
Type:
arrayvalidationResultsAdditional Properties Allowed:Minimum Number of Items:0
Nested Schema : validationResults
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- detail
-
Type:
stringRequired:trueMessage that provides the error details. - o:ecid
-
Type:
stringRequired:trueExecution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components. - o:errorCode
-
Type:
stringRequired:trueThe service's error code. - o:errorDetails
-
Type:
objecterrorDetailsAdditional Properties Allowed: - o:errorPath
-
Type:
stringRequired:trueThe relative point in the API path where the error occurred. - status
-
Type:
integer(int64)Required:trueHTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details. - title
-
Type:
stringRequired:trueSummary of the problem. - type
-
Type:
stringRequired:trueThe URI to the link that provides details about the HTTP status code.
Nested Schema : errorDetails
Type:
object- detail
-
Type:
stringRequired:true - o:errorDetails
-
Type:
objecterrorDetailsAdditional Properties Allowed: - title
-
Type:
stringRequired:trueSummary of the problem. - type
-
Type:
stringRequired:trueThe URI to the link that provides details about the HTTP status code.
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":[]}