Behzad Koohi
Behzad Koohi

Reputation: 1

SoftLayer_Virtual_Guest setTransientWebhook

I'm looking for a sample code using SoftLayer_Virtual_Guest::setTransientWebhook for Transient VSI. Is there a sample code?

Thanks Behzad

Upvotes: 0

Views: 46

Answers (2)

Behzad Koohi
Behzad Koohi

Reputation: 1

Thanks Daniel, would this be equivalent code in python: request = client['Virtual_Guest'].createObject({ 'hostname': hostname, 'domain': domainname, 'startCpus': cpus, 'maxMemory': memory, 'hourlyBillingFlag': 'true', 'datacenter': {'name': 'tor01'}, 'operatingSystemReferenceCode': os_code, # 'localDiskFlag': 'false', "supplementalCreateObjectOptions": {"flavorKeyName": "C1_1X1X25"}, 'transientGuestFlag': 'true', # 'sshKeys': [{"id":201867}] "parameters":["https://test1.com","testsupport"].

Upvotes: 0

Daniel Cabero
Daniel Cabero

Reputation: 316

Try with next requests:

Method GET

http://api.softlayer.com/rest/v3.1/SoftLayer_Account/getVirtualGuests?objectMask=mask[id,transientGuestFlag]&objectFilter={"virtualGuests":{"transientGuestFlag":{"operation": 1}}}

Data 1 means true also 0 means false, in this case, we use one with data 1

Choose the VSI id you want to set and use the following request:

Method POST

http://api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/111111/setTransientWebhook

Body

{"parameters":[
       "https://test1.com",
       "testsupport"]
}

The 111111 data is the VSI that we chose in the previous request.

Reference

https://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest/#transientGuestFlag https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/setTransientWebhook/

I hope it helps you

Upvotes: 1

Related Questions