Automation, APIs, and Scripting for Service Delivery
This section covers Automation, APIs, and Scripting for Service Delivery: Prism APIs, API versioning, task polling, authentication, and scripting practices for repeatable operations.
Automation rules
- Prism exposes REST APIs; Prism Element and Prism Central have different endpoints and API versions. Confirm the target before scripting.
- Many operations are asynchronous and return a task UUID. Poll the task until success or failure instead of assuming immediate completion.
- Avoid hardcoded credentials. Use protected secrets, service accounts with least privilege, and rotation.
- Validate inputs and handle HTTP errors, task failures, and timeouts. Log enough context to troubleshoot.
- Use idempotent patterns where possible so reruns do not create duplicate objects.
Worked example
A script lists VMs and powers on a selected VM through the Prism API. It authenticates with a scoped account, calls the correct API version, and receives a task UUID for the power operation. The script polls the task endpoint and checks the final status before reporting success. If it treated the initial HTTP 202 as completion, it could report success while the VM is still powering on or has failed.
Traps that cost marks
Do not mix Prism Element and Prism Central endpoints without checking. Do not ignore asynchronous task state. Do not embed admin passwords in scripts. Do not assume a successful HTTP response means the operation finished.