From ac485050fb60645423bdbb97ba812be10ff7d135 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Tue, 26 Jan 2021 12:18:52 -0600 Subject: [PATCH] 20210126 Updates for new services and datatypes --- datatypes/container.go | 28 ++++++++++- datatypes/network.go | 8 +++ services/network.go | 108 +++++++++++++++++++++++++++++++++++++++-- services/user.go | 8 ++- services/virtual.go | 9 ++++ 5 files changed, 155 insertions(+), 6 deletions(-) diff --git a/datatypes/container.go b/datatypes/container.go index dd32f56..72e704d 100644 --- a/datatypes/container.go +++ b/datatypes/container.go @@ -2237,6 +2237,32 @@ type Container_Network_Bandwidth_Version1_Usage struct { RecordedDate *Time `json:"recordedDate,omitempty" xmlrpc:"recordedDate,omitempty"` } +// The SoftLayer_Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader data type contains information for specific responses from the modify response header API. +type Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader struct { + Entity + + // Specifies the delimiter to be used when indicating multiple values for a header. Valid delimiter is, a , , (comma), ; (semicolon), , (comma and space), or ; (semicolon and space). + Delimiter *string `json:"delimiter,omitempty" xmlrpc:"delimiter,omitempty"` + + // The description of modify response header. + Description *string `json:"description,omitempty" xmlrpc:"description,omitempty"` + + // A collection of key value pairs that specify the headers and associated values to be modified. The header name and header value must be separated by colon (:). Example: ['header1:value1','header2:Value2'] + Headers []string `json:"headers,omitempty" xmlrpc:"headers,omitempty"` + + // The uniqueId of the modify response header to which the existing behavior belongs. + ModResHeaderUniqueId *string `json:"modResHeaderUniqueId,omitempty" xmlrpc:"modResHeaderUniqueId,omitempty"` + + // The path, relative to the domain that is accessed via modify response header. + Path *string `json:"path,omitempty" xmlrpc:"path,omitempty"` + + // The type of the modify response header, could be append/modify/delete. Set this to append to add a given header value to a header name set in the headerList. Set this to delete to remove a given header value from a header name set in the headerList. Set this to overwrite to match on a specified header name and replace its existing header value with a new one you specify. + Type *string `json:"type,omitempty" xmlrpc:"type,omitempty"` + + // The uniqueId of the mapping to which the existing behavior belongs. + UniqueId *string `json:"uniqueId,omitempty" xmlrpc:"uniqueId,omitempty"` +} + // The SoftLayer_Container_Network_CdnMarketplace_Configuration_Behavior_TokenAuth data type contains information for specific responses from the Token Authentication API. type Container_Network_CdnMarketplace_Configuration_Behavior_TokenAuth struct { Entity @@ -3621,7 +3647,7 @@ type Container_Product_Order struct { // Device Fingerprint Identifier - Optional. DeviceFingerprintId *string `json:"deviceFingerprintId,omitempty" xmlrpc:"deviceFingerprintId,omitempty"` - // This is the configuration identifier for tracking orders on the HTML order forms. + // This has been deprecated. It is the identifier used to track configurations in legacy order forms. DisplayLayerSessionId *string `json:"displayLayerSessionId,omitempty" xmlrpc:"displayLayerSessionId,omitempty"` // no documentation yet diff --git a/datatypes/network.go b/datatypes/network.go index 4bdadc3..9b085cc 100644 --- a/datatypes/network.go +++ b/datatypes/network.go @@ -986,6 +986,11 @@ type Network_CdnMarketplace_Configuration_Behavior_HotlinkProtection struct { RefererValues *string `json:"refererValues,omitempty" xmlrpc:"refererValues,omitempty"` } +// no documentation yet +type Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader struct { + Entity +} + // no documentation yet type Network_CdnMarketplace_Configuration_Behavior_TokenAuth struct { Entity @@ -3901,6 +3906,9 @@ type Network_Storage struct { // Determines whether dependent volume provision is completed on background. IsDependentDuplicateProvisionCompleted *bool `json:"isDependentDuplicateProvisionCompleted,omitempty" xmlrpc:"isDependentDuplicateProvisionCompleted,omitempty"` + // no documentation yet + IsInDedicatedServiceResource *bool `json:"isInDedicatedServiceResource,omitempty" xmlrpc:"isInDedicatedServiceResource,omitempty"` + // Determines whether a volume is ready to order snapshot space, or, if snapshot space is already available, to assign a snapshot schedule, or to take a manual snapshot. IsReadyForSnapshot *bool `json:"isReadyForSnapshot,omitempty" xmlrpc:"isReadyForSnapshot,omitempty"` diff --git a/services/network.go b/services/network.go index 5f26dca..feb8078 100644 --- a/services/network.go +++ b/services/network.go @@ -2077,6 +2077,89 @@ func (r Network_CdnMarketplace_Configuration_Behavior_HotlinkProtection) UpdateH return } +// no documentation yet +type Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader struct { + Session *session.Session + Options sl.Options +} + +// GetNetworkCdnMarketplaceConfigurationBehaviorModifyResponseHeaderService returns an instance of the Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader SoftLayer service +func GetNetworkCdnMarketplaceConfigurationBehaviorModifyResponseHeaderService(sess *session.Session) Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader { + return Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader{Session: sess} +} + +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) Id(id int) Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader { + r.Options.Id = &id + return r +} + +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) Mask(mask string) Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader { + if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { + mask = fmt.Sprintf("mask[%s]", mask) + } + + r.Options.Mask = mask + return r +} + +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) Filter(filter string) Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader { + r.Options.Filter = filter + return r +} + +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) Limit(limit int) Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader { + r.Options.Limit = &limit + return r +} + +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) Offset(offset int) Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader { + r.Options.Offset = &offset + return r +} + +// no documentation yet +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) CreateModifyResponseHeader(input *datatypes.Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) (resp datatypes.Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader, err error) { + params := []interface{}{ + input, + } + err = r.Session.DoRequest("SoftLayer_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader", "createModifyResponseHeader", params, &r.Options, &resp) + return +} + +// no documentation yet +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) DeleteModifyResponseHeader(uniqueId *string, modResHeaderUniqueId *string) (resp string, err error) { + params := []interface{}{ + uniqueId, + modResHeaderUniqueId, + } + err = r.Session.DoRequest("SoftLayer_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader", "deleteModifyResponseHeader", params, &r.Options, &resp) + return +} + +// no documentation yet +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) GetObject() (resp datatypes.Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader, err error) { + err = r.Session.DoRequest("SoftLayer_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader", "getObject", nil, &r.Options, &resp) + return +} + +// no documentation yet +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) ListModifyResponseHeader(uniqueId *string) (resp []datatypes.Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader, err error) { + params := []interface{}{ + uniqueId, + } + err = r.Session.DoRequest("SoftLayer_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader", "listModifyResponseHeader", params, &r.Options, &resp) + return +} + +// no documentation yet +func (r Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) UpdateModifyResponseHeader(input *datatypes.Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader) (resp []datatypes.Container_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader, err error) { + params := []interface{}{ + input, + } + err = r.Session.DoRequest("SoftLayer_Network_CdnMarketplace_Configuration_Behavior_ModifyResponseHeader", "updateModifyResponseHeader", params, &r.Options, &resp) + return +} + // no documentation yet type Network_CdnMarketplace_Configuration_Behavior_TokenAuth struct { Session *session.Session @@ -4591,12 +4674,13 @@ func (r Network_Gateway_VersionUpgrade) GetObject() (resp datatypes.Network_Gate return } -// Used to get a list per package of prices ids for allowed vSRX OS-es for new orders +// Used to get a list per package of prices ids for allowed vSRX OS-es for new orders. // // -func (r Network_Gateway_VersionUpgrade) GetVsrxOrdersAllowedOS(accountId *int) (resp []datatypes.Product_Package_Item_Prices, err error) { +func (r Network_Gateway_VersionUpgrade) GetVsrxOrdersAllowedOS(accountId *int, validate *bool) (resp []datatypes.Product_Package_Item_Prices, err error) { params := []interface{}{ accountId, + validate, } err = r.Session.DoRequest("SoftLayer_Network_Gateway_VersionUpgrade", "getVsrxOrdersAllowedOS", params, &r.Options, &resp) return @@ -8051,6 +8135,12 @@ func (r Network_Storage) GetIsDependentDuplicateProvisionCompleted() (resp bool, return } +// Retrieve +func (r Network_Storage) GetIsInDedicatedServiceResource() (resp bool, err error) { + err = r.Session.DoRequest("SoftLayer_Network_Storage", "getIsInDedicatedServiceResource", nil, &r.Options, &resp) + return +} + // Retrieve Determines whether a volume is ready to order snapshot space, or, if snapshot space is already available, to assign a snapshot schedule, or to take a manual snapshot. func (r Network_Storage) GetIsReadyForSnapshot() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Network_Storage", "getIsReadyForSnapshot", nil, &r.Options, &resp) @@ -10198,6 +10288,12 @@ func (r Network_Storage_Backup_Evault) GetIsDependentDuplicateProvisionCompleted return } +// Retrieve +func (r Network_Storage_Backup_Evault) GetIsInDedicatedServiceResource() (resp bool, err error) { + err = r.Session.DoRequest("SoftLayer_Network_Storage_Backup_Evault", "getIsInDedicatedServiceResource", nil, &r.Options, &resp) + return +} + // Retrieve Determines whether a volume is ready to order snapshot space, or, if snapshot space is already available, to assign a snapshot schedule, or to take a manual snapshot. func (r Network_Storage_Backup_Evault) GetIsReadyForSnapshot() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Network_Storage_Backup_Evault", "getIsReadyForSnapshot", nil, &r.Options, &resp) @@ -12416,6 +12512,12 @@ func (r Network_Storage_Iscsi) GetIsDependentDuplicateProvisionCompleted() (resp return } +// Retrieve +func (r Network_Storage_Iscsi) GetIsInDedicatedServiceResource() (resp bool, err error) { + err = r.Session.DoRequest("SoftLayer_Network_Storage_Iscsi", "getIsInDedicatedServiceResource", nil, &r.Options, &resp) + return +} + // Retrieve Determines whether a volume is ready to order snapshot space, or, if snapshot space is already available, to assign a snapshot schedule, or to take a manual snapshot. func (r Network_Storage_Iscsi) GetIsReadyForSnapshot() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Network_Storage_Iscsi", "getIsReadyForSnapshot", nil, &r.Options, &resp) @@ -15053,7 +15155,7 @@ func (r Network_Tunnel_Module_Context) AddServiceSubnetToNetworkTunnel(subnetId return } -// A transaction will be created to apply the IPSec network tunnel's configuration to SoftLayer network devices. During this time, an IPSec network tunnel cannot be modified in anyway. Only one network tunnel configuration transaction can be created. If a transaction has been created or is running, a new transaction cannot be created until the previous transaction completes. +// An asynchronous task will be created to apply the IPSec network tunnel's configuration to network devices. During this time, an IPSec network tunnel cannot be modified in anyway. Only one network tunnel configuration task can be created at a time. If a task has already been created and has not completed, a new task cannot be created. func (r Network_Tunnel_Module_Context) ApplyConfigurationsToDevice() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Network_Tunnel_Module_Context", "applyConfigurationsToDevice", nil, &r.Options, &resp) return diff --git a/services/user.go b/services/user.go index 5064ef1..963c1ef 100644 --- a/services/user.go +++ b/services/user.go @@ -293,7 +293,9 @@ func (r User_Customer) CreateNotificationSubscriber(keyName *string, resourceTab // // vpnPassword If the vpnPassword is provided, then the user's vpnPassword will be set to the provided password.  When creating a vpn only user, the vpnPassword MUST be supplied.  If the vpnPassword is not provided, then the user will need to use the portal to edit their profile and set the vpnPassword. // -// IBMid considerations When a SoftLayer account is linked to a Platform Services (PaaS, formerly Bluemix) account, AND the trait on the SoftLayer Account indicating IBMid authentication is set, then SoftLayer will delegate the creation of the user to PaaS. The Platform Services "invite user" API call is asynchronous, and so no user object can be returned from this API call. In this specific case, this API will throw a SoftLayer_Exception_User_Customer_DelegateIamIdInvitationToPaas exception, with text indicating that the call was at least accepted by Platform Services. The Platform Services API is the preferred API for creating users based on IBMid in a linked account pair. If you have automation using this API that depends on getting a synchronous response with a user object with an id, you should contact SoftLayer Support to have the "IBMid authentication" trait set to 0 on this account. In that case, a normal SoftLayer user will be created (no IBMid association set up) and the createObject call will return synchronously as before. +// IBMid considerations When a SoftLayer account is linked to a Platform Services (PaaS, formerly Bluemix) account, AND the trait on the SoftLayer Account indicating IBMid authentication is set, then SoftLayer will delegate the creation of an ACTIVE user to PaaS. This means that even though the request to create a new user in such an account may start at the IMS API, via this delegation we effectively turn it into a request that is driven by PaaS. In particular this means that any "invitation email" that comes to the user, will come from PaaS, not from IMS via IBMid. +// +// Users created in states other than ACTIVE (for example, a VPN_ONLY user) will be created directly in IMS without delegation (but note that no invitation is sent for a user created in any state other than ACTIVE). func (r User_Customer) CreateObject(templateObject *datatypes.User_Customer, password *string, vpnPassword *string) (resp datatypes.User_Customer, err error) { params := []interface{}{ templateObject, @@ -2730,7 +2732,9 @@ func (r User_Customer_OpenIdConnect) CreateNotificationSubscriber(keyName *strin // // vpnPassword If the vpnPassword is provided, then the user's vpnPassword will be set to the provided password.  When creating a vpn only user, the vpnPassword MUST be supplied.  If the vpnPassword is not provided, then the user will need to use the portal to edit their profile and set the vpnPassword. // -// IBMid considerations When a SoftLayer account is linked to a Platform Services (PaaS, formerly Bluemix) account, AND the trait on the SoftLayer Account indicating IBMid authentication is set, then SoftLayer will delegate the creation of the user to PaaS. The Platform Services "invite user" API call is asynchronous, and so no user object can be returned from this API call. In this specific case, this API will throw a SoftLayer_Exception_User_Customer_DelegateIamIdInvitationToPaas exception, with text indicating that the call was at least accepted by Platform Services. The Platform Services API is the preferred API for creating users based on IBMid in a linked account pair. If you have automation using this API that depends on getting a synchronous response with a user object with an id, you should contact SoftLayer Support to have the "IBMid authentication" trait set to 0 on this account. In that case, a normal SoftLayer user will be created (no IBMid association set up) and the createObject call will return synchronously as before. +// IBMid considerations When a SoftLayer account is linked to a Platform Services (PaaS, formerly Bluemix) account, AND the trait on the SoftLayer Account indicating IBMid authentication is set, then SoftLayer will delegate the creation of an ACTIVE user to PaaS. This means that even though the request to create a new user in such an account may start at the IMS API, via this delegation we effectively turn it into a request that is driven by PaaS. In particular this means that any "invitation email" that comes to the user, will come from PaaS, not from IMS via IBMid. +// +// Users created in states other than ACTIVE (for example, a VPN_ONLY user) will be created directly in IMS without delegation (but note that no invitation is sent for a user created in any state other than ACTIVE). func (r User_Customer_OpenIdConnect) CreateObject(templateObject *datatypes.User_Customer_OpenIdConnect, password *string, vpnPassword *string) (resp datatypes.User_Customer_OpenIdConnect, err error) { params := []interface{}{ templateObject, diff --git a/services/virtual.go b/services/virtual.go index feda831..0a39e02 100644 --- a/services/virtual.go +++ b/services/virtual.go @@ -859,6 +859,15 @@ func (r Virtual_Guest) ExecuteRescueLayer() (resp bool, err error) { return } +// Find VSIs by hostname. +func (r Virtual_Guest) FindByHostname(hostname *string) (resp []datatypes.Virtual_Guest, err error) { + params := []interface{}{ + hostname, + } + err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "findByHostname", params, &r.Options, &resp) + return +} + // Find CCI by only its primary public or private IP address. IP addresses within secondary subnets tied to the CCI will not return the CCI. If no CCI is found, no errors are generated and no data is returned. func (r Virtual_Guest) FindByIpAddress(ipAddress *string) (resp datatypes.Virtual_Guest, err error) { params := []interface{}{