Follow these steps to deploy your files using the API:
Step 1: Authenticate
Use a SSO Token to acquire your bearer token for API authorization.
Step 2: Target VCF Objects
Create a Target Group or manually target VCF objects. Follow instructions on how to create a target group or target VCF Objects manually from the TechDocs.
Step 3: Upload Jinja and State Files
Use the
fs.write_file API method to upload your Jinja variable definitions and SLS state configuration to the Master file server.
# Upload Jinja file
curl -X POST https://<raas>/rpc \
-H "Authorization: Bearer <token>" \
-d '{"resource": "fs", "method": "write_file", "kwarg": {"path": "/my_vcenter_component.jinja", "content": "<base64_jinja>"}}'
# Upload SLS file
curl -X POST https://<raas>/rpc \
-H "Authorization: Bearer <token>" \
-d '{"resource": "fs", "method": "write_file", "kwarg": {"path": "/my_vcenter_component_state_file.sls", "content": "<base64_sls>"}}'
Step 4: Run Assessment
Use the
job.run API method to execute the state against your targeted minions.
curl -X POST https://<raas>/rpc \
-H "Authorization: Bearer <token>" \
-d '{"resource": "job", "method": "run", "kwarg": {"target": "vcenter-minions", "fun": "state.apply", "arg": ["my_vcenter_component_state_file"]}}'
Step 5: Monitor & Remediate
Track execution using the job status and job return API endpoints. If non-compliant items are found, execute a remediation job.