Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

{

“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

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

https://cmpuat.mphasis.comDev/vm/create

HTTP Method

POST

Additional headers

"x-api-key": {API-key}

"authorization_token": {auth-token}

Payload

{

"doc": [ {

"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”: “”

},

{

"number": "VM 2",

“sl_no": 2,

"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”: “”

},

{

"number": "VM 3",

“sl_no": 3,

"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”: “”

}]

}

Responce

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

{

"doc": [ {

"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”: “”

},

{

"number": "VM 2",

“sl_no": 2,

"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”: “”

},

{

"number": "VM 3",

“sl_no": 3,

"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”: “”

}]

}

Response

{

“status”: “success”,

“Message”:  “The request has been approved and is being processed. Further updates will be sent via 

email”e-mail”

}

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

{

"doc": [ {

"resource":"VM",

"provider": "AZURE",

"environment": "Nextgen-RD",

"project_code": "98203",

"project_name": "CIO",

"hostname": "SRVAZUCHETES550",

"ip_address": "10.14.48.34",

"update_actions": ["compute_size"],

"new_instance_type": "Standard_B2s",

“Proposed_cpu”: “2”,

“Proposed_ram”: “4”,

"Propose_disk_list": "10,20",

"new_disk_list": "35,25",

"request_number":"REQxxxxxx"

}]

}

Response

{

“status”: “success”,

“Message”:  “The request has been approved and is being processed. Further updates will be sent via email”via email”

}

Payload Key Details

  • provider: Azure/AWS

  • environment: same environment options as available in single vm form

  • hostname: hostname of the VM to be upgraded

  • ip_address: private ip address of the VM to be upgraded

  • resource_group: Must be sent if the VM to be upgraded is in Azure. If not in Azure, send as an empty 

string - ””.

  • update_actions: This specifies the type of upgrade. Must be passed in list of string format.

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"]

  • new_instance_type: New instance type which the user has selected

  • new_disk_list: must be a string with comma-separated sizes of new disks

  • Propose_disk_list: must be a string with comma-separated sizes of new disks

  • request_number: Ticket number

Note: 

  • if no new disk to be added then new_disk_list value must be an empty string ("").

  • If no upgrade is required for any of the existing disk, you can send an empty string for Propose_disk_list.

  • If an upgrade is required then Propose_disk_list must have the disks in correct order with new size.        

 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

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

https://cmpuat.mphasis.com/Dev/discovery/rg-data

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 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 VM size and disk details of a VM which already exist in CMDB from the 

cloud and post it back to CMDB.

API

https://cmpuat.mphasis.com/Dev/discovery/vm

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:
GET method on https://cmpuat.mphasis.com/Dev/discovery/vm with the query parameters :

{

'environment': 'UAT', 

'provider': 'AZURE', 

'resource_name': 'SRVAZUCHEAZV032’

}

...