setAssociationId


SoftLayer_Billing_Item::setAssociationId

Set the associated billing item for an orphan billing item.

Description

Set an associated billing item to an orphan billing item. Associations allow you to tie an “orphaned” billing item, any non-server billing item that doesn’t have a parent item such as secondary IP subnets or StorageLayer accounts, to a server billing item. You may only set an association for an orphan to a server. You cannot associate a server to an orphan if the either the server or orphan billing items have a cancellation date set.

Parameters

Name Type Description
associatedId int the billing item to associate to this item

Required Headers

Optional Headers

  • None

Return Values

  • boolean

Error Handling

  • Throw the exception “This billing item is not an orphan billing item.” if the current billing item has a parent item or already has an association defined.
  • Throw the exception “There was a problem fetching data for the associated billing Item ([associatedId])” if the SoftLayer API is unable to locate the billing item you wish to associate.
  • Throw the exception “You may only associate orphan billing items to server billing items. You chose a [categoryCode] billing item.” if the billing item you’re attempting to associate is not a server billing item.
  • Throw the exception “You may not associate to this billing item ($associatedId) as it is scheduled for cancellation.” if the associated billing item has a cancellationDate set.

Associated Methods

curl -g -u $SL_USER:$SL_APIKEY -X POST -d '{"parameters": [int]}' \
'https://api.softlayer.com/rest/v3.1/SoftLayer_Billing_Item/{SoftLayer_Billing_ItemID}/setAssociationId'