VMware Cloud Community
kev01228
Enthusiast
Enthusiast
Jump to solution

Deployment.Update : Update a deployment via API

Hi,
I am trying to update an existing deployment with a vm count of 2 but cannot figure it out no matter what combination use.  In the UI, I can Update the deployment by bumping the count up but no luck when using the API. In swagger (or postman) I keep getting the message that "'inputs' is required." no matter what I try to update and not matter what format i use.  

 

Anyone had any luck with this? The below no worky..

 

/deployment/api/deployments/{deploymentId}/requests

{
"actionId": "Deployment.Update",
"inputs": {"count":"2"},
"reason": "string"
}

 

Thanks is advanced

0 Kudos
1 Solution

Accepted Solutions
marcethz
Enthusiast
Enthusiast
Jump to solution

Hi kev01228

I can confirm this is working (8.6.2) when passing ALL the "inputs" you get from 

{{url-home}}/deployment/api/deployments/{{deploymentId}}

and modifying the values you want. Is it possible that you are only passing the value you're trying to update instead of passing everything ?

Edit:

I just tested what happens if I only pass the value I intend to modify: 

1. Deployment "inputs" from {{url-home}}/deployment/api/deployments/{{deploymentId}}:

 

"inputs": {
        "someInput": "randomString",
        "networkType": "external"
    }

 

 

2. POST to {{url-home}}/deployment/api/deployments/{{deploymentId}}/requests :

 

{
  "actionId": "Deployment.Update",
  "inputs": {"networkType": "internal"},
  "reason": "change network"
}

 

 

Return Body:

 

{
    "message": "'someInput' is required.",
    "statusCode": 400,
    "errorCode": 10006
}

 

 

So in my case the message contains exactly the key that is missing. In your case it is "inputs". It would be interesting to see your output of 

{{url-home}}/deployment/api/deployments/{{deploymentId}}

 

View solution in original post

0 Kudos
3 Replies
xian_
Expert
Expert
Jump to solution

Fetch the previous inputs used to create the deployment with a GET request /deployment/api/deployments/" + deploymentId

The inputs are under the key "inputs"

Modify the count and POST that back to the API

kev01228
Enthusiast
Enthusiast
Jump to solution

Hi,
Thanks for the reply. I started down the path you mentioned initially but no matter what I put for "inputs" (or the syntax in which I put it) , I get back one of the below messages

"message": "'inputs' is required.",
"message": "Invalid request body.",

 

I am unable to update any property, not just the vm count. In the below examples, I am trying to update the user with the below syntaxes but I get the same results; message "inputs is required"

 

{
  "actionId": "Deployment.Update",
  "inputs": {"user":"testuser"},
  "reason": "please work"
}

 

 

 

{
  "actionId": "Deployment.Update",
  "inputs": {
        "properties": {
          "user":"testuser"}
		}
}

 

 

Feedback appreciated!

 

0 Kudos
marcethz
Enthusiast
Enthusiast
Jump to solution

Hi kev01228

I can confirm this is working (8.6.2) when passing ALL the "inputs" you get from 

{{url-home}}/deployment/api/deployments/{{deploymentId}}

and modifying the values you want. Is it possible that you are only passing the value you're trying to update instead of passing everything ?

Edit:

I just tested what happens if I only pass the value I intend to modify: 

1. Deployment "inputs" from {{url-home}}/deployment/api/deployments/{{deploymentId}}:

 

"inputs": {
        "someInput": "randomString",
        "networkType": "external"
    }

 

 

2. POST to {{url-home}}/deployment/api/deployments/{{deploymentId}}/requests :

 

{
  "actionId": "Deployment.Update",
  "inputs": {"networkType": "internal"},
  "reason": "change network"
}

 

 

Return Body:

 

{
    "message": "'someInput' is required.",
    "statusCode": 400,
    "errorCode": 10006
}

 

 

So in my case the message contains exactly the key that is missing. In your case it is "inputs". It would be interesting to see your output of 

{{url-home}}/deployment/api/deployments/{{deploymentId}}

 

0 Kudos