要更新Account profile,我们需要创建一个 Request Profile Update 使用SoftLayer_Ticket::createAdministrativeTicket
看:
http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/createAdministrativeTicket
SOAP 示例:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v3="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<SoftLayer_ObjectMask xsi:type="v3:SoftLayer_ObjectMask">
<mask xsi:type="xsd:string">1</mask>
</SoftLayer_ObjectMask>
<SoftLayer_TicketObjectMask xsi:type="v3:SoftLayer_TicketObjectMask">
<mask xsi:type="v3:SoftLayer_Ticket" />
</SoftLayer_TicketObjectMask>
<authenticate xsi:type="v3:authenticate">
<username xsi:type="xsd:string">?</username>
<apiKey xsi:type="xsd:string">?</apiKey>
</authenticate>
</soapenv:Header>
<soapenv:Body>
<v3:createAdministrativeTicket soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<templateObject xsi:type="v3:SoftLayer_Ticket">
<assignedUserId xsi:type="xsd:int">12345</assignedUserId>
<notifyUserOnUpdateFlag xsi:type="xsd:boolean">true</notifyUserOnUpdateFlag>
<title xsi:type="xsd:string">Account Profile Update Request</title>
</templateObject>
<contents xsi:type="xsd:string">address1: "Address Edited"
address2: "newAddress2"
city: "cityEdited"
companyName: "My Company"
country: "BR"
email: "mynewemail@softlayer.com"
faxPhone: ""
firstName: "EditedName"
lastName: "Last Name"
officePhone: "123456789"
postalCode: "11111-2222"</contents>
<rootPassword xsi:type="xsd:string">TestPassword</rootPassword>
<controlPanelPassword xsi:type="xsd:string">TestPassword</controlPanelPassword>
<accessPort xsi:type="xsd:string">22</accessPort>
<attachedFiles xsi:type="v3:SoftLayer_Container_Utility_File_AttachmentArray" />
</v3:createAdministrativeTicket>
</soapenv:Body>
</soapenv:Envelope>
如何获取“assignedUserId”?
利用:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getMasterUser
参考:
http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/createAdministrativeTicket
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getMasterUser
REST 示例:
网址:
https://[用户名]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Ticket/createAdministrativeTicket
方法: POST
Json(有效负载):
{
"parameters": [
{
"assignedUserId": 12345,
"title": "Account Profile Update Request"
},
"Request generated via API\nCompany Name: myComanyName\nFirst Name: nameEdited\nLast Name: LastNameEdited\nEmail: mynewemail@softlayer.com \nPrimary Phone: 21478270366\nSecondary Phone: \nStreet Address 1: myAddressEdited\nStreet Address 2: \nCity: newCity\nCountry: US\nState: CA\nPostal Code: 111-222\n"
]
}