使用 Rest Api 从多 Vlan 中删除插件
Remove an addon from a Multi-Vlan using Rest Api
有没有什么方法可以使用 Softlayer rest api 从多 vlan 中删除附加组件?。如果是这样,请告诉我请求正文应该是什么。我知道可以通过控制门户完成。
要从 Multi-Vlan 中删除附加组件,您可以使用以下命令 api:
方法:POST
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Billing_Item/[billingItemId]/cancelItem
正文:Json
{
"parameters":[
true,
true,
"reason",
"customerNote"
]
}
参考:
https://softlayer.github.io/reference/services/SoftLayer_Billing_Item/cancelItem/
要获取计费项目 ID,请使用此剩余 api:
方法:获取
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Vlan_Firewall/[networkVlanFirewallId]/getObject?objectMask=mask[billingItem.activeChildren[categoryCode,id,description]]
参考:
https://softlayer.github.io/reference/services/SoftLayer_Network_Vlan_Firewall/getObject/
您将收到如下示例的响应:
{
"administrativeBypassFlag": "",
"customerManagedFlag": true,
"id": 11111,
"billingItem": {
"categoryCode": "firewall_appliance",
"description": "FortiGate Security Appliance",
"id": 33333333,
"laborFee": "0",
"laborFeeTaxRate": "0",
"modifyDate": "2018-06-13T06:24:57-06:00",
"nextBillDate": "2018-07-03T23:00:00-06:00",
"recurringFeeTaxRate": "0",
"recurringMonths": 1
"activeChildren": [
{
"categoryCode": "bandwidth",
"description": "20000 GB Bandwidth",
"id": 39999999
},
{
"categoryCode": "firewall_appliance_ha_pair",
"description": "FortiGate Firewall Appliance HA Option",
"id": 32222222
},
{
"categoryCode": "firewall_appliance_addon_bundle",
"description": "FortiGate Security Appliance - Add-on bundle (NGFW, Web, AV) (High Availability)",
"id": 333333333
},
{
"categoryCode": "firewall_appliance_addon_antivirus",
"description": "FortiGate Security Appliance - AV Add-on (High Availability)",
"id": 344444444
},
{
"categoryCode": "firewall_appliance_addon_next_gen_service",
"description": "FortiGate Security Appliance - NGFW Add-on (High Availability)",
"id": 311111111
},
{
"categoryCode": "firewall_appliance_addon_web_filter",
"description": "FortiGate Security Appliance - Web Filtering Add-on (High Availability)",
"id": 355555555
}
]
}
}
如果您想删除所有附加配置,请使用 billingItem id。要一一删除,请使用最后四个“activeChildren”Ids 选项,它们的顺序与门户控件中的顺序相同。
有没有什么方法可以使用 Softlayer rest api 从多 vlan 中删除附加组件?。如果是这样,请告诉我请求正文应该是什么。我知道可以通过控制门户完成。
要从 Multi-Vlan 中删除附加组件,您可以使用以下命令 api:
方法:POST
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Billing_Item/[billingItemId]/cancelItem
正文:Json
{
"parameters":[
true,
true,
"reason",
"customerNote"
]
}
参考:
https://softlayer.github.io/reference/services/SoftLayer_Billing_Item/cancelItem/
要获取计费项目 ID,请使用此剩余 api:
方法:获取
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Vlan_Firewall/[networkVlanFirewallId]/getObject?objectMask=mask[billingItem.activeChildren[categoryCode,id,description]]
参考:
https://softlayer.github.io/reference/services/SoftLayer_Network_Vlan_Firewall/getObject/
您将收到如下示例的响应:
{
"administrativeBypassFlag": "",
"customerManagedFlag": true,
"id": 11111,
"billingItem": {
"categoryCode": "firewall_appliance",
"description": "FortiGate Security Appliance",
"id": 33333333,
"laborFee": "0",
"laborFeeTaxRate": "0",
"modifyDate": "2018-06-13T06:24:57-06:00",
"nextBillDate": "2018-07-03T23:00:00-06:00",
"recurringFeeTaxRate": "0",
"recurringMonths": 1
"activeChildren": [
{
"categoryCode": "bandwidth",
"description": "20000 GB Bandwidth",
"id": 39999999
},
{
"categoryCode": "firewall_appliance_ha_pair",
"description": "FortiGate Firewall Appliance HA Option",
"id": 32222222
},
{
"categoryCode": "firewall_appliance_addon_bundle",
"description": "FortiGate Security Appliance - Add-on bundle (NGFW, Web, AV) (High Availability)",
"id": 333333333
},
{
"categoryCode": "firewall_appliance_addon_antivirus",
"description": "FortiGate Security Appliance - AV Add-on (High Availability)",
"id": 344444444
},
{
"categoryCode": "firewall_appliance_addon_next_gen_service",
"description": "FortiGate Security Appliance - NGFW Add-on (High Availability)",
"id": 311111111
},
{
"categoryCode": "firewall_appliance_addon_web_filter",
"description": "FortiGate Security Appliance - Web Filtering Add-on (High Availability)",
"id": 355555555
}
]
}
}
如果您想删除所有附加配置,请使用 billingItem id。要一一删除,请使用最后四个“activeChildren”Ids 选项,它们的顺序与门户控件中的顺序相同。