...
Cloud Provider | AZURE |
---|---|
Services | Azure blob storage |
Description | Contains the initial scripts to be run on AZURE VMs. Located in Nextgen environment (servicenow-rg) |
Items/names | cmpscript |
API Details:
CMP API COLLECTION
Function | Single VM Creation |
---|---|
Description | To provision a VM in a particular cloud environment based on the configurations described in the payload. CMDB will be updated on each success case. |
API | |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Function | Multiple VM Creation |
---|---|
Description | Multi Cloud -Multi VM Provisioning based on the configurations described in the payload. CMDB will be updated on each success case. |
API | |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Responce | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via e-mail” } In case of a Retry, retry flag must be added to the payload for both single and multiple VM use case Sample payload: { “doc”: [{ “retry”: “true” "number": "VM 1", "sl_no": 1, "provider": "AZURE", "OS": "Redhat Enterprise Linux (RHEL)", "software": "", "primary_owner": "Meinathan.P01@mphasis.com", "secondary_owner": "Prakash.Rawat@mphasis.com", "additional_user":"Meinathan.P01@mphasis.com,Prakash.Rawat@mphasis.com", "disk_size": "128", "extra_disk": "50,80", "instance_type": "Standard_B2s", "resource_group": "servicenow-rg", "new_resource_group": "", "price": "64.266”, "sysID": "d77dcd24db6e4414218936cb7c9619db", "resource": "VM", "requested_by": "netalytics team", "environment": "Nextgen-RD", "project_code": "98203", "request_number": "REQxxxxxx", "project_name": "CIO_Cloud_CSP", "application_name": "testappp" “server_role”: “”, “cpu”: “”, “memory”: “”, “autoshutdown”: “” }] } |
Function | Modify VM |
---|---|
Description | To modify VM configurations. CMDB will be updated on each success case |
Functionality | Modify instance type, upgrade disk size, add new |
API | disks.https://cmpuat.mphasis.com/Dev/vm/update |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via email” } |
Function | Modify VM |
---|---|
Description | To modify VM configurations. CMDB will be updated on each success case |
Functionality | Modify instance type(upgrade/ Degrade), upgrade disk size, add new discs |
API | disks.https://cmpuat.mphasis.com/Dev/vm/update |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via email” } |
Payload Key Details |
string - ””.
Possible values: compute_size (for modifying the instance_type of a vm) data_disk_add: to add an additional disk upgrade_disk: To upgrade an existing disk For Instance, if u need to update both compute size and upgrade an existing disk you have to pass values in the following manner: "update_actions": ["compute_size","upgrade_disk"]
|
Note:
For Intance: existing disks of a vm: "10,20,30" If the user wants to change disk2 size from 20 to 50 then, Propose_disk_list value will be: "10,50,30" |
Function | VM Decommission |
---|---|
Description | To delete a VM and its sub-resources. CMDB will be updated on each success case |
Functionality | Backup, Retention, Disjoin domain, Destroy VM |
API | |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Payload Response Key | backup (boolean): true | false - true if backup is required else false. backup_disk_ids (list/array): [<disk_ids>] - list of disk IDs which the user wants to backup retention (number): 1 | 3 | 6 | 12 - backup retention period in months |
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via email” } |
Function | Retry |
---|---|
Description | When clicked failed VM to be initiated to create |
Functionality | Retry function for both Single and Multiple VM |
Payload |
|
Function | Azure Resource group data discovery |
---|---|
Description | To fetch all resource group data from each environment in the Azure cloud. Created for ServiceNow to fetch the data and populate in the user form |
API | |
HTTP METHOD | GET |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Query parameters | None |
Response | Resource group data (name, project name, project code, primary owner, secondary owner) for each environment in JSON format. { “uat”: [ {....}, {....}....,{....}], “nextgen-rd”: [ {....}, {....}....,{....}],......} |
Note: For now this api will provide data for only DEV/UAT and Nextgen-RD environment as we don't have access to other environments as of now. |
Function | Resource name-based Discovery |
---|---|
Description | To fetch the current vm size and disk details of a VM which already exist in CMDB from the cloud and post it back to CMDB. |
API | |
HTTP METHOD | GET |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Query parameters | provider - AWS | AZURE environment - Nextgen-RD | UAT | DEV.. etc resource_name - The hostname of the VM |
Example: { 'environment': 'UAT', 'provider': 'AZURE', 'resource_name': 'SRVAZUCHEAZV032’ } |