From 4142df473ff1b4c5217d7cd21eff9e78838c6b32 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 23 May 2024 14:37:32 -0500 Subject: [PATCH] 20240523 services/datatypes updates --- .secrets.baseline | 12 +- datatypes/account.go | 24 ++-- datatypes/billing.go | 10 -- datatypes/container.go | 13 -- datatypes/location.go | 1 + datatypes/network.go | 112 ++--------------- services/account.go | 67 ++++++++-- services/account_test.go | 60 +++++++-- services/hardware.go | 66 ++++++++++ services/hardware_test.go | 63 ++++++++++ services/network.go | 259 ++++---------------------------------- services/network_test.go | 200 ++--------------------------- services/virtual.go | 7 ++ services/virtual_test.go | 7 ++ 14 files changed, 318 insertions(+), 583 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 4e6336c..15cea32 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2024-04-18T14:44:04Z", + "generated_at": "2024-05-23T19:37:19Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -126,7 +126,7 @@ "hashed_secret": "319f96013e95ce7556aa082a9dd58dce40aeff0f", "is_secret": false, "is_verified": false, - "line_number": 1870, + "line_number": 1877, "type": "Secret Keyword", "verified_result": null }, @@ -134,7 +134,7 @@ "hashed_secret": "fa9250fd74ad6c9f6737049b5bd842709fbf4ae3", "is_secret": false, "is_verified": false, - "line_number": 1877, + "line_number": 1884, "type": "Secret Keyword", "verified_result": null }, @@ -142,7 +142,7 @@ "hashed_secret": "bf9130647c179bd2b6992bcf2db4560b91bc513d", "is_secret": false, "is_verified": false, - "line_number": 1884, + "line_number": 1891, "type": "Secret Keyword", "verified_result": null }, @@ -150,7 +150,7 @@ "hashed_secret": "0f39e6d6c8aafa1e3e723d1b06aef02ead75b908", "is_secret": false, "is_verified": false, - "line_number": 1891, + "line_number": 1898, "type": "Secret Keyword", "verified_result": null }, @@ -158,7 +158,7 @@ "hashed_secret": "5487abf5507e25b18b47a3e8cd1ecfdea8c0e9e9", "is_secret": false, "is_verified": false, - "line_number": 1898, + "line_number": 1905, "type": "Secret Keyword", "verified_result": null } diff --git a/datatypes/account.go b/datatypes/account.go index f7a07bc..f878d4f 100644 --- a/datatypes/account.go +++ b/datatypes/account.go @@ -257,6 +257,9 @@ type Account struct { // Private template group objects (parent and children) and the shared template group objects (parent only) for an account. BlockDeviceTemplateGroups []Virtual_Guest_Block_Device_Template_Group `json:"blockDeviceTemplateGroups,omitempty" xmlrpc:"blockDeviceTemplateGroups,omitempty"` + // Flag indicating whether this account is restricted from performing a self-service brand migration by updating their credit card details. + BlockSelfServiceBrandMigration *bool `json:"blockSelfServiceBrandMigration,omitempty" xmlrpc:"blockSelfServiceBrandMigration,omitempty"` + // no documentation yet BluemixAccountId *string `json:"bluemixAccountId,omitempty" xmlrpc:"bluemixAccountId,omitempty"` @@ -423,13 +426,6 @@ type Account struct { // no documentation yet GlobalIpv6Records []Network_Subnet_IpAddress_Global `json:"globalIpv6Records,omitempty" xmlrpc:"globalIpv6Records,omitempty"` - // A count of [Deprecated] The global load balancer accounts for a softlayer customer account. - GlobalLoadBalancerAccountCount *uint `json:"globalLoadBalancerAccountCount,omitempty" xmlrpc:"globalLoadBalancerAccountCount,omitempty"` - - // [Deprecated] The global load balancer accounts for a softlayer customer account. - // Deprecated: This function has been marked as deprecated. - GlobalLoadBalancerAccounts []Network_LoadBalancer_Global_Account `json:"globalLoadBalancerAccounts,omitempty" xmlrpc:"globalLoadBalancerAccounts,omitempty"` - // An account's associated hardware objects. Hardware []Hardware `json:"hardware,omitempty" xmlrpc:"hardware,omitempty"` @@ -3082,3 +3078,17 @@ type Account_Status struct { // no documentation yet Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` } + +// no documentation yet +type Account_Status_Change_Reason struct { + Entity + + // no documentation yet + Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` + + // no documentation yet + KeyName *string `json:"keyName,omitempty" xmlrpc:"keyName,omitempty"` + + // no documentation yet + Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` +} diff --git a/datatypes/billing.go b/datatypes/billing.go index bd900a3..e4b72c3 100644 --- a/datatypes/billing.go +++ b/datatypes/billing.go @@ -1522,16 +1522,6 @@ type Billing_Item_Network_LoadBalancer struct { Billing_Item } -// The global load balancer service has been deprecated and is no longer available. -// -// The SoftLayer_Billing_Item_Network_LoadBalancer_Global data type contains general information relating to a single SoftLayer billing item whose item category code is 'global_load_balancer' -type Billing_Item_Network_LoadBalancer_Global struct { - Billing_Item - - // The resource for a global load balancer billing item. - Resource *Network_LoadBalancer_Global_Account `json:"resource,omitempty" xmlrpc:"resource,omitempty"` -} - // A SoftLayer_Billing_Item_Network_LoadBalancer_VirtualIpAddress represents the [[SoftLayer_Billing_Item|billing item]] related to a single [[SoftLayer_Network_LoadBalancer_VirtualIpAddress|load balancer]] instance. type Billing_Item_Network_LoadBalancer_VirtualIpAddress struct { Billing_Item diff --git a/datatypes/container.go b/datatypes/container.go index 78942b9..575a6c0 100644 --- a/datatypes/container.go +++ b/datatypes/container.go @@ -3946,19 +3946,6 @@ type Container_Product_Order_Network_LoadBalancer_AsAService struct { UseSystemPublicIpPool *bool `json:"useSystemPublicIpPool,omitempty" xmlrpc:"useSystemPublicIpPool,omitempty"` } -// The global load balancer service has been deprecated and is no longer available. -// -// This is the datatype that needs to be populated and sent to SoftLayer_Product_Order::placeOrder. This datatype has everything required to place a global load balancer order with SoftLayer. -type Container_Product_Order_Network_LoadBalancer_Global struct { - Container_Product_Order - - // The domain name that will be load balanced. - Domain *string `json:"domain,omitempty" xmlrpc:"domain,omitempty"` - - // The hostname that will be load balanced. - Hostname *string `json:"hostname,omitempty" xmlrpc:"hostname,omitempty"` -} - // This is the datatype that needs to be populated and sent to SoftLayer_Product_Order::placeOrder. This datatype has everything required to place a network message delivery order with SoftLayer. type Container_Product_Order_Network_Message_Delivery struct { Container_Product_Order diff --git a/datatypes/location.go b/datatypes/location.go index 2eb4ed5..ea5f0c3 100644 --- a/datatypes/location.go +++ b/datatypes/location.go @@ -27,6 +27,7 @@ type Location struct { BackboneDependentCount *uint `json:"backboneDependentCount,omitempty" xmlrpc:"backboneDependentCount,omitempty"` // no documentation yet + // Deprecated: This function has been marked as deprecated. BackboneDependents []Network_Backbone_Location_Dependent `json:"backboneDependents,omitempty" xmlrpc:"backboneDependents,omitempty"` // A flag indicating whether or not the datacenter/location is BNPP compliant. diff --git a/datatypes/network.go b/datatypes/network.go index 8d07d93..3c1164b 100644 --- a/datatypes/network.go +++ b/datatypes/network.go @@ -567,19 +567,22 @@ type Network_Backbone struct { // The unit portion of the bandwidth capacity of a SoftLayer backbone. For instance, if a backbone is rated at "10 G" capacity then the capacityUnits property of the backbone is "G". CapacityUnits *string `json:"capacityUnits,omitempty" xmlrpc:"capacityUnits,omitempty"` - // A backbone's status. + // [Deprecated] A backbone's status. + // Deprecated: This function has been marked as deprecated. Health *string `json:"health,omitempty" xmlrpc:"health,omitempty"` // A backbone's internal identifier. Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` - // Which of the SoftLayer datacenters a backbone is connected to. + // [Deprecated] Which of the SoftLayer datacenters a backbone is connected to. + // Deprecated: This function has been marked as deprecated. Location *Location `json:"location,omitempty" xmlrpc:"location,omitempty"` // A backbone's name. This is usually the name of the backbone's network provider followed by a number in case SoftLayer uses more than one backbone from a provider. Backbone provider numbers start with the number one and increment from there. Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` - // A backbone's primary network component. + // [Deprecated] A backbone's primary network component. + // Deprecated: This function has been marked as deprecated. NetworkComponent *Network_Component `json:"networkComponent,omitempty" xmlrpc:"networkComponent,omitempty"` // The internal identifier of the network component that backbone is connected to. @@ -594,6 +597,7 @@ type Network_Backbone_Location_Dependent struct { Entity // no documentation yet + // Deprecated: This function has been marked as deprecated. DependentLocation *Location `json:"dependentLocation,omitempty" xmlrpc:"dependentLocation,omitempty"` // no documentation yet @@ -603,6 +607,7 @@ type Network_Backbone_Location_Dependent struct { Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` // no documentation yet + // Deprecated: This function has been marked as deprecated. SourceLocation *Location `json:"sourceLocation,omitempty" xmlrpc:"sourceLocation,omitempty"` // no documentation yet @@ -1883,9 +1888,6 @@ type Network_Gateway_Member_Attribute struct { // Username associated with the gateway. Username *string `json:"username,omitempty" xmlrpc:"username,omitempty"` - // The vSRX version of the gateway software - VSRXVersion *string `json:"vSRXVersion,omitempty" xmlrpc:"vSRXVersion,omitempty"` - // The version of the gateway software Version *string `json:"version,omitempty" xmlrpc:"version,omitempty"` @@ -2738,104 +2740,6 @@ type Network_LBaaS_SessionAffinity struct { Type *string `json:"type,omitempty" xmlrpc:"type,omitempty"` } -// The global load balancer service has been deprecated and is no longer available. -type Network_LoadBalancer_Global_Account struct { - Entity - - // Your SoftLayer customer account. - Account *Account `json:"account,omitempty" xmlrpc:"account,omitempty"` - - // The maximum number of hosts that a global load balancer account is allowed to have. - AllowedNumberOfHosts *int `json:"allowedNumberOfHosts,omitempty" xmlrpc:"allowedNumberOfHosts,omitempty"` - - // The average amount of connections per second used within the current billing cycle. This number is updated daily. - AverageConnectionsPerSecond *Float64 `json:"averageConnectionsPerSecond,omitempty" xmlrpc:"averageConnectionsPerSecond,omitempty"` - - // The current billing item for a Global Load Balancer account. - BillingItem *Billing_Item `json:"billingItem,omitempty" xmlrpc:"billingItem,omitempty"` - - // The amount of connections per second a global load balancer account may use within a billing cycle without being billed for an overage. - ConnectionsPerSecond *int `json:"connectionsPerSecond,omitempty" xmlrpc:"connectionsPerSecond,omitempty"` - - // The IP address that will be return to a DNS request when none of the hosts for a global load balancer account could be returned. - FallbackIp *string `json:"fallbackIp,omitempty" xmlrpc:"fallbackIp,omitempty"` - - // A count of the hosts in the load balancing pool for a global load balancer account. - HostCount *uint `json:"hostCount,omitempty" xmlrpc:"hostCount,omitempty"` - - // The hostname of a global load balancer account that is being load balanced. - Hostname *string `json:"hostname,omitempty" xmlrpc:"hostname,omitempty"` - - // The hosts in the load balancing pool for a global load balancer account. - Hosts []Network_LoadBalancer_Global_Host `json:"hosts,omitempty" xmlrpc:"hosts,omitempty"` - - // The unique identifier of a global load balancer account. - Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` - - // The load balance method of a global load balancer account - LoadBalanceType *Network_LoadBalancer_Global_Type `json:"loadBalanceType,omitempty" xmlrpc:"loadBalanceType,omitempty"` - - // The identifier of the load balance method for a global load balancer account. - LoadBalanceTypeId *int `json:"loadBalanceTypeId,omitempty" xmlrpc:"loadBalanceTypeId,omitempty"` - - // A flag indicating that the global load balancer is a managed resource. - ManagedResourceFlag *bool `json:"managedResourceFlag,omitempty" xmlrpc:"managedResourceFlag,omitempty"` - - // Additional customer defined information for a global load balancer account. - Notes *string `json:"notes,omitempty" xmlrpc:"notes,omitempty"` -} - -// The global load balancer service has been deprecated and is no longer available. -type Network_LoadBalancer_Global_Host struct { - Entity - - // The IP address of the host that will be returned by the global load balancers in response to a dns request. - DestinationIp *string `json:"destinationIp,omitempty" xmlrpc:"destinationIp,omitempty"` - - // The port of the host that will be used for health checks. - DestinationPort *int `json:"destinationPort,omitempty" xmlrpc:"destinationPort,omitempty"` - - // Whether the host is enabled or not. The value can be '0' for disabled, or '1' for enabled. - Enabled *int `json:"enabled,omitempty" xmlrpc:"enabled,omitempty"` - - // The health check type of a host. Valid values include 'none', 'http', and 'tcp'. - HealthCheck *string `json:"healthCheck,omitempty" xmlrpc:"healthCheck,omitempty"` - - // The number of times the host was selected by the load balance method. - Hits *Float64 `json:"hits,omitempty" xmlrpc:"hits,omitempty"` - - // The unique identifier of a global load balancer host. - Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` - - // The order of this host within the load balance pool. This is only significant if the load balance method is set to failover. - LoadBalanceOrder *int `json:"loadBalanceOrder,omitempty" xmlrpc:"loadBalanceOrder,omitempty"` - - // The global load balancer account a host belongs to. - LoadBalancerAccount *Network_LoadBalancer_Global_Account `json:"loadBalancerAccount,omitempty" xmlrpc:"loadBalancerAccount,omitempty"` - - // The location of a host in a datacenter.serverRoom format. - Location *string `json:"location,omitempty" xmlrpc:"location,omitempty"` - - // The health status of a host. The status can be either 'UP', 'DOWN', or null which could mean that the health check type is set to 'none' or an update to the ip, port, or health check type was recently done and the host is waiting for the new status. - Status *string `json:"status,omitempty" xmlrpc:"status,omitempty"` - - // The load balance weight of a host. The total weight of all hosts in the load balancing pool must not exceed 100. - Weight *int `json:"weight,omitempty" xmlrpc:"weight,omitempty"` -} - -// The global load balancer service has been deprecated and is no longer available. -// -// The SoftLayer_Network_LoadBalancer_Global_Type data type represents a single load balance method that can be assigned to a global load balancer account. The load balance method determines how hosts in a load balancing pool are chosen by the global load balancers. -type Network_LoadBalancer_Global_Type struct { - Entity - - // The unique identifier of a load balance method. - Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` - - // The name of a load balance method. - Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` -} - // The SoftLayer_Network_LoadBalancer_Service data type contains all the information relating to a specific service (destination) on a particular load balancer. // // Information retained on the object itself is the the source and destination of the service, routing type, weight, and whether or not the service is currently enabled. diff --git a/services/account.go b/services/account.go index d962b41..9801d1a 100644 --- a/services/account.go +++ b/services/account.go @@ -537,6 +537,12 @@ func (r Account) GetBlockDeviceTemplateGroups() (resp []datatypes.Virtual_Guest_ return } +// Retrieve Flag indicating whether this account is restricted from performing a self-service brand migration by updating their credit card details. +func (r Account) GetBlockSelfServiceBrandMigration() (resp bool, err error) { + err = r.Session.DoRequest("SoftLayer_Account", "getBlockSelfServiceBrandMigration", nil, &r.Options, &resp) + return +} + // Retrieve func (r Account) GetBluemixAccountId() (resp string, err error) { err = r.Session.DoRequest("SoftLayer_Account", "getBluemixAccountId", nil, &r.Options, &resp) @@ -747,12 +753,6 @@ func (r Account) GetGlobalIpv6Records() (resp []datatypes.Network_Subnet_IpAddre return } -// Retrieve [Deprecated] The global load balancer accounts for a softlayer customer account. -func (r Account) GetGlobalLoadBalancerAccounts() (resp []datatypes.Network_LoadBalancer_Global_Account, err error) { - err = r.Session.DoRequest("SoftLayer_Account", "getGlobalLoadBalancerAccounts", nil, &r.Options, &resp) - return -} - // Retrieve An account's associated hardware objects. func (r Account) GetHardware() (resp []datatypes.Hardware, err error) { err = r.Session.DoRequest("SoftLayer_Account", "getHardware", nil, &r.Options, &resp) @@ -3505,9 +3505,10 @@ func (r Account_Lockdown_Request) CancelRequest() (err error) { } // Takes the original lockdown request ID, and an optional disable date. If no date is passed with the API call, the account will be disabled immediately. Otherwise, the account will be disabled on the date given. All hardware will be reclaimed and all accounts permanently disabled. -func (r Account_Lockdown_Request) DisableLockedAccount(disableDate *string) (resp int, err error) { +func (r Account_Lockdown_Request) DisableLockedAccount(disableDate *string, statusChangeReasonKeyName *string) (resp int, err error) { params := []interface{}{ disableDate, + statusChangeReasonKeyName, } err = r.Session.DoRequest("SoftLayer_Account_Lockdown_Request", "disableLockedAccount", params, &r.Options, &resp) return @@ -5580,3 +5581,55 @@ func (r Account_Shipment_Type) GetObject() (resp datatypes.Account_Shipment_Type err = r.Session.DoRequest("SoftLayer_Account_Shipment_Type", "getObject", nil, &r.Options, &resp) return } + +// no documentation yet +type Account_Status_Change_Reason struct { + Session session.SLSession + Options sl.Options +} + +// GetAccountStatusChangeReasonService returns an instance of the Account_Status_Change_Reason SoftLayer service +func GetAccountStatusChangeReasonService(sess session.SLSession) Account_Status_Change_Reason { + return Account_Status_Change_Reason{Session: sess} +} + +func (r Account_Status_Change_Reason) Id(id int) Account_Status_Change_Reason { + r.Options.Id = &id + return r +} + +func (r Account_Status_Change_Reason) Mask(mask string) Account_Status_Change_Reason { + 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 Account_Status_Change_Reason) Filter(filter string) Account_Status_Change_Reason { + r.Options.Filter = filter + return r +} + +func (r Account_Status_Change_Reason) Limit(limit int) Account_Status_Change_Reason { + r.Options.Limit = &limit + return r +} + +func (r Account_Status_Change_Reason) Offset(offset int) Account_Status_Change_Reason { + r.Options.Offset = &offset + return r +} + +// no documentation yet +func (r Account_Status_Change_Reason) GetAllObjects() (resp []datatypes.Account_Status_Change_Reason, err error) { + err = r.Session.DoRequest("SoftLayer_Account_Status_Change_Reason", "getAllObjects", nil, &r.Options, &resp) + return +} + +// no documentation yet +func (r Account_Status_Change_Reason) GetObject() (resp datatypes.Account_Status_Change_Reason, err error) { + err = r.Session.DoRequest("SoftLayer_Account_Status_Change_Reason", "getObject", nil, &r.Options, &resp) + return +} diff --git a/services/account_test.go b/services/account_test.go index 9d22c61..772c365 100644 --- a/services/account_test.go +++ b/services/account_test.go @@ -511,6 +511,13 @@ var _ = Describe("Account Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Account::getBlockSelfServiceBrandMigration", func() { + It("API Call Test", func() { + _, err := sl_service.GetBlockSelfServiceBrandMigration() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Account::getBluemixAccountId", func() { It("API Call Test", func() { _, err := sl_service.GetBluemixAccountId() @@ -742,13 +749,6 @@ var _ = Describe("Account Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) - Context("SoftLayer_Account::getGlobalLoadBalancerAccounts", func() { - It("API Call Test", func() { - _, err := sl_service.GetGlobalLoadBalancerAccounts() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Account::getHardware", func() { It("API Call Test", func() { _, err := sl_service.GetHardware() @@ -3452,7 +3452,7 @@ var _ = Describe("Account Tests", func() { }) Context("SoftLayer_Account_Lockdown_Request::disableLockedAccount", func() { It("API Call Test", func() { - _, err := sl_service.DisableLockedAccount(nil) + _, err := sl_service.DisableLockedAccount(nil, nil) Expect(err).To(Succeed()) Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) @@ -5236,4 +5236,48 @@ var _ = Describe("Account Tests", func() { }) }) + Context("Testing SoftLayer_Account_Status_Change_Reason service", func() { + var sl_service services.Account_Status_Change_Reason + BeforeEach(func() { + sl_service = services.GetAccountStatusChangeReasonService(slsession) + }) + Context("SoftLayer_Account_Status_Change_Reason Set Options", func() { + It("Set Options properly", func() { + t_id := 1234 + t_filter := "{'testFilter':{'test'}}" + t_limit := 100 + t_offset := 5 + sl_service = sl_service.Id(t_id).Filter(t_filter).Offset(t_offset).Limit(t_limit) + Expect(sl_service.Options.Id).To(HaveValue(Equal(t_id))) + Expect(sl_service.Options.Filter).To(HaveValue(Equal(t_filter))) + Expect(sl_service.Options.Limit).To(HaveValue(Equal(t_limit))) + Expect(sl_service.Options.Offset).To(HaveValue(Equal(t_offset))) + }) + }) + Context("SoftLayer_Account_Status_Change_Reason Set Mask", func() { + It("Set Options properly", func() { + t_mask1 := "mask[test,test2]" + sl_service = sl_service.Mask(t_mask1) + Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) + // Mask("test,test2") should set the mask to be "mask[test,test2]" aka t_mask1 + sl_service = sl_service.Mask("test,test2") + Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) + }) + }) + Context("SoftLayer_Account_Status_Change_Reason::getAllObjects", func() { + It("API Call Test", func() { + _, err := sl_service.GetAllObjects() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) + Context("SoftLayer_Account_Status_Change_Reason::getObject", func() { + It("API Call Test", func() { + _, err := sl_service.GetObject() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) + }) + }) diff --git a/services/hardware.go b/services/hardware.go index c1d9bde..19da233 100644 --- a/services/hardware.go +++ b/services/hardware.go @@ -3665,6 +3665,15 @@ func (r Hardware_SecurityModule) CaptureImage(captureTemplate *datatypes.Contain return } +// Changes the power state for the server. The server's power status is changed from its remote management card. +func (r Hardware_SecurityModule) ChangeRedfishPowerState(state *string) (resp bool, err error) { + params := []interface{}{ + state, + } + err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule", "changeRedfishPowerState", params, &r.Options, &resp) + return +} + // You can launch firmware reflash by selecting from your server list. It will bring your server offline for approximately 60 minutes while the flashes are in progress. // // In the event of a hardware failure during this our datacenter engineers will be notified of the problem automatically. They will then replace any failed components to bring your server back online, and will be contacting you to ensure that impact on your server is minimal. @@ -5275,6 +5284,12 @@ func (r Hardware_SecurityModule) GetRecentRemoteManagementCommands() (resp []dat return } +// Retrieves the power state for the server. The server's power status is retrieved from its remote management card. This will return 'on' or 'off'. +func (r Hardware_SecurityModule) GetRedfishPowerState() (resp string, err error) { + err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule", "getRedfishPowerState", nil, &r.Options, &resp) + return +} + // Retrieve func (r Hardware_SecurityModule) GetRegionalInternetRegistry() (resp datatypes.Network_Regional_Internet_Registry, err error) { err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule", "getRegionalInternetRegistry", nil, &r.Options, &resp) @@ -5953,6 +5968,13 @@ func (r Hardware_SecurityModule) ValidatePartitionsForOperatingSystem(operatingS return } +// no documentation yet +func (r Hardware_SecurityModule) ValidateSecurityLevel() (err error) { + var resp datatypes.Void + err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule", "validateSecurityLevel", nil, &r.Options, &resp) + return +} + // no documentation yet type Hardware_SecurityModule750 struct { Session session.SLSession @@ -6049,6 +6071,15 @@ func (r Hardware_SecurityModule750) CaptureImage(captureTemplate *datatypes.Cont return } +// Changes the power state for the server. The server's power status is changed from its remote management card. +func (r Hardware_SecurityModule750) ChangeRedfishPowerState(state *string) (resp bool, err error) { + params := []interface{}{ + state, + } + err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "changeRedfishPowerState", params, &r.Options, &resp) + return +} + // You can launch firmware reflash by selecting from your server list. It will bring your server offline for approximately 60 minutes while the flashes are in progress. // // In the event of a hardware failure during this our datacenter engineers will be notified of the problem automatically. They will then replace any failed components to bring your server back online, and will be contacting you to ensure that impact on your server is minimal. @@ -7659,6 +7690,12 @@ func (r Hardware_SecurityModule750) GetRecentRemoteManagementCommands() (resp [] return } +// Retrieves the power state for the server. The server's power status is retrieved from its remote management card. This will return 'on' or 'off'. +func (r Hardware_SecurityModule750) GetRedfishPowerState() (resp string, err error) { + err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "getRedfishPowerState", nil, &r.Options, &resp) + return +} + // Retrieve func (r Hardware_SecurityModule750) GetRegionalInternetRegistry() (resp datatypes.Network_Regional_Internet_Registry, err error) { err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "getRegionalInternetRegistry", nil, &r.Options, &resp) @@ -8337,6 +8374,13 @@ func (r Hardware_SecurityModule750) ValidatePartitionsForOperatingSystem(operati return } +// no documentation yet +func (r Hardware_SecurityModule750) ValidateSecurityLevel() (err error) { + var resp datatypes.Void + err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "validateSecurityLevel", nil, &r.Options, &resp) + return +} + // The SoftLayer_Hardware_Server data type contains general information relating to a single SoftLayer server. type Hardware_Server struct { Session session.SLSession @@ -8433,6 +8477,15 @@ func (r Hardware_Server) CaptureImage(captureTemplate *datatypes.Container_Disk_ return } +// Changes the power state for the server. The server's power status is changed from its remote management card. +func (r Hardware_Server) ChangeRedfishPowerState(state *string) (resp bool, err error) { + params := []interface{}{ + state, + } + err = r.Session.DoRequest("SoftLayer_Hardware_Server", "changeRedfishPowerState", params, &r.Options, &resp) + return +} + // You can launch firmware reflash by selecting from your server list. It will bring your server offline for approximately 60 minutes while the flashes are in progress. // // In the event of a hardware failure during this our datacenter engineers will be notified of the problem automatically. They will then replace any failed components to bring your server back online, and will be contacting you to ensure that impact on your server is minimal. @@ -10043,6 +10096,12 @@ func (r Hardware_Server) GetRecentRemoteManagementCommands() (resp []datatypes.H return } +// Retrieves the power state for the server. The server's power status is retrieved from its remote management card. This will return 'on' or 'off'. +func (r Hardware_Server) GetRedfishPowerState() (resp string, err error) { + err = r.Session.DoRequest("SoftLayer_Hardware_Server", "getRedfishPowerState", nil, &r.Options, &resp) + return +} + // Retrieve func (r Hardware_Server) GetRegionalInternetRegistry() (resp datatypes.Network_Regional_Internet_Registry, err error) { err = r.Session.DoRequest("SoftLayer_Hardware_Server", "getRegionalInternetRegistry", nil, &r.Options, &resp) @@ -10720,3 +10779,10 @@ func (r Hardware_Server) ValidatePartitionsForOperatingSystem(operatingSystem *d err = r.Session.DoRequest("SoftLayer_Hardware_Server", "validatePartitionsForOperatingSystem", params, &r.Options, &resp) return } + +// no documentation yet +func (r Hardware_Server) ValidateSecurityLevel() (err error) { + var resp datatypes.Void + err = r.Session.DoRequest("SoftLayer_Hardware_Server", "validateSecurityLevel", nil, &r.Options, &resp) + return +} diff --git a/services/hardware_test.go b/services/hardware_test.go index 3b1c590..bd4e385 100644 --- a/services/hardware_test.go +++ b/services/hardware_test.go @@ -3194,6 +3194,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_SecurityModule::changeRedfishPowerState", func() { + It("API Call Test", func() { + _, err := sl_service.ChangeRedfishPowerState(nil) + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Hardware_SecurityModule::createFirmwareReflashTransaction", func() { It("API Call Test", func() { _, err := sl_service.CreateFirmwareReflashTransaction(nil, nil, nil) @@ -4580,6 +4587,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_SecurityModule::getRedfishPowerState", func() { + It("API Call Test", func() { + _, err := sl_service.GetRedfishPowerState() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Hardware_SecurityModule::getRegionalInternetRegistry", func() { It("API Call Test", func() { _, err := sl_service.GetRegionalInternetRegistry() @@ -5203,6 +5217,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_SecurityModule::validateSecurityLevel", func() { + It("API Call Test", func() { + err := sl_service.ValidateSecurityLevel() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) }) Context("Testing SoftLayer_Hardware_SecurityModule750 service", func() { @@ -5275,6 +5296,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_SecurityModule750::changeRedfishPowerState", func() { + It("API Call Test", func() { + _, err := sl_service.ChangeRedfishPowerState(nil) + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Hardware_SecurityModule750::createFirmwareReflashTransaction", func() { It("API Call Test", func() { _, err := sl_service.CreateFirmwareReflashTransaction(nil, nil, nil) @@ -6661,6 +6689,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_SecurityModule750::getRedfishPowerState", func() { + It("API Call Test", func() { + _, err := sl_service.GetRedfishPowerState() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Hardware_SecurityModule750::getRegionalInternetRegistry", func() { It("API Call Test", func() { _, err := sl_service.GetRegionalInternetRegistry() @@ -7284,6 +7319,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_SecurityModule750::validateSecurityLevel", func() { + It("API Call Test", func() { + err := sl_service.ValidateSecurityLevel() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) }) Context("Testing SoftLayer_Hardware_Server service", func() { @@ -7356,6 +7398,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_Server::changeRedfishPowerState", func() { + It("API Call Test", func() { + _, err := sl_service.ChangeRedfishPowerState(nil) + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Hardware_Server::createFirmwareReflashTransaction", func() { It("API Call Test", func() { _, err := sl_service.CreateFirmwareReflashTransaction(nil, nil, nil) @@ -8742,6 +8791,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_Server::getRedfishPowerState", func() { + It("API Call Test", func() { + _, err := sl_service.GetRedfishPowerState() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Hardware_Server::getRegionalInternetRegistry", func() { It("API Call Test", func() { _, err := sl_service.GetRegionalInternetRegistry() @@ -9365,6 +9421,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_Server::validateSecurityLevel", func() { + It("API Call Test", func() { + err := sl_service.ValidateSecurityLevel() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) }) }) diff --git a/services/network.go b/services/network.go index bfe239d..86d9540 100644 --- a/services/network.go +++ b/services/network.go @@ -94,6 +94,24 @@ func (r Network) DisconnectPrivateEndpointService() (resp bool, err error) { return } +// Initiate the change of the private network to VRF, which will cause a brief private network outage. +// +// @SLDNDocumentation Method Permissions NETWORK_VLAN_SPANNING +// +//

Responses

+// +// True The request to change the private network has been accepted and the change will begin immediately. +// +// False The request had no change because the private network is already in a VRF or in the process of converting to VRF. +// +//

Exceptions

+// +// SoftLayer_Exception_NotReady Thrown when the current private network cannot be converted to VRF without specialized assistance. +func (r Network) EnableVrf() (resp bool, err error) { + err = r.Session.DoRequest("SoftLayer_Network", "enableVrf", nil, &r.Options, &resp) + return +} + // Accessing select IBM Cloud services attached to the private back-end network is made possible by establishing a network relationship between an account's private network and the Service Endpoint network. // //

Responses

@@ -1247,6 +1265,7 @@ func (r Network_Application_Delivery_Controller_LoadBalancer_VirtualServer) Stop } // A SoftLayer_Network_Backbone represents a single backbone connection from SoftLayer to the public Internet, from the Internet to the SoftLayer private network, or a link that connects the private networks between SoftLayer's datacenters. The SoftLayer_Network_Backbone data type is a collection of data associated with one of those connections. +// Deprecated: This function has been marked as deprecated. type Network_Backbone struct { Session session.SLSession Options sl.Options @@ -1301,19 +1320,19 @@ func (r Network_Backbone) GetBackbonesForLocationName(locationName *string) (res return } -// Retrieve A backbone's status. +// Retrieve [Deprecated] A backbone's status. func (r Network_Backbone) GetHealth() (resp string, err error) { err = r.Session.DoRequest("SoftLayer_Network_Backbone", "getHealth", nil, &r.Options, &resp) return } -// Retrieve Which of the SoftLayer datacenters a backbone is connected to. +// Retrieve [Deprecated] Which of the SoftLayer datacenters a backbone is connected to. func (r Network_Backbone) GetLocation() (resp datatypes.Location, err error) { err = r.Session.DoRequest("SoftLayer_Network_Backbone", "getLocation", nil, &r.Options, &resp) return } -// Retrieve A backbone's primary network component. +// Retrieve [Deprecated] A backbone's primary network component. func (r Network_Backbone) GetNetworkComponent() (resp datatypes.Network_Component, err error) { err = r.Session.DoRequest("SoftLayer_Network_Backbone", "getNetworkComponent", nil, &r.Options, &resp) return @@ -1326,6 +1345,7 @@ func (r Network_Backbone) GetObject() (resp datatypes.Network_Backbone, err erro } // no documentation yet +// Deprecated: This function has been marked as deprecated. type Network_Backbone_Location_Dependent struct { Session session.SLSession Options sl.Options @@ -3996,44 +4016,6 @@ func (r Network_Gateway) BypassVlans(vlans []datatypes.Network_Gateway_Vlan) (er return } -// Used to create a transaction to upgrade or rollback the vSRX version for Juniper gateway. -func (r Network_Gateway) ChangeGatewayVersion(versionId *int, rollbackVersion *bool) (resp bool, err error) { - params := []interface{}{ - versionId, - rollbackVersion, - } - err = r.Session.DoRequest("SoftLayer_Network_Gateway", "changeGatewayVersion", params, &r.Options, &resp) - return -} - -// no documentation yet -func (r Network_Gateway) CheckAccountWhiteList(accountId *int, category *string) (resp bool, err error) { - params := []interface{}{ - accountId, - category, - } - err = r.Session.DoRequest("SoftLayer_Network_Gateway", "checkAccountWhiteList", params, &r.Options, &resp) - return -} - -// Create and return a new gateway. This object can be created with any number of members or VLANs, but they all must be in the same pod. By creating a gateway with members and/or VLANs attached, it is the equivalent of individually calling their createObject methods except this will start a single asynchronous process to setup the gateway. The status of this process can be checked using the status field. -func (r Network_Gateway) CreateObject(templateObject *datatypes.Network_Gateway) (resp datatypes.Network_Gateway, err error) { - params := []interface{}{ - templateObject, - } - err = r.Session.DoRequest("SoftLayer_Network_Gateway", "createObject", params, &r.Options, &resp) - return -} - -// Edit this gateway. Currently, the only value that can be edited is the name. -func (r Network_Gateway) EditObject(templateObject *datatypes.Network_Gateway) (resp bool, err error) { - params := []interface{}{ - templateObject, - } - err = r.Session.DoRequest("SoftLayer_Network_Gateway", "editObject", params, &r.Options, &resp) - return -} - // Purpose is to rebuild the target Gateway cluster with the specified OS price id. Method will remove the current OS and apply the default configuration settings. This will result in an extended OUTAGE!! Any custom configuration settings must be re-applied after the forced rebuild is completed. This is a DESTRUCTIVE action, use with caution. func (r Network_Gateway) ForceRebuildCluster(osPriceId *int) (resp bool, err error) { params := []interface{}{ @@ -4164,15 +4146,6 @@ func (r Network_Gateway) GetUpgradeItemPrices() (resp []datatypes.Product_Item_P return } -// no documentation yet -func (r Network_Gateway) IsAccountWhiteListed(category *string) (resp bool, err error) { - params := []interface{}{ - category, - } - err = r.Session.DoRequest("SoftLayer_Network_Gateway", "isAccountWhiteListed", params, &r.Options, &resp) - return -} - // no documentation yet func (r Network_Gateway) IsLicenseServerAllowed(licenseKeyName *string) (resp bool, err error) { params := []interface{}{ @@ -4182,12 +4155,6 @@ func (r Network_Gateway) IsLicenseServerAllowed(licenseKeyName *string) (resp bo return } -// Returns true if rollback is allowed. -func (r Network_Gateway) IsRollbackAllowed() (resp bool, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Gateway", "isRollbackAllowed", nil, &r.Options, &resp) - return -} - // Used to manage gateway require and add on licenses. If license request is valid for the gateway type a Gateway License Manage process will be created if licenses need to be adjusted on the gateway. // // requiredItemKeyname - Item Key Name of the required license to be used on the gateway addOnLicenses - Json string containing an Add On license Item Key Name and requested total quantity to exist on each gateway member. Item Key Name must be associated with an Add On license product item and Item Key Name can only exist once in the json structure. @@ -4216,7 +4183,7 @@ func (r Network_Gateway) RebuildvSRXHACluster() (resp bool, err error) { return } -// Used to refresh the license for the Juniper Gateway, requires License readiness check has passed. +// Used to refresh the all licenses (Required and add ons) for Virtual gateways. License precheck must be ready. func (r Network_Gateway) RefreshGatewayLicense() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Network_Gateway", "refreshGatewayLicense", nil, &r.Options, &resp) return @@ -4620,15 +4587,6 @@ func (r Network_Gateway_VersionUpgrade) Offset(offset int) Network_Gateway_Versi return r } -// no documentation yet -func (r Network_Gateway_VersionUpgrade) GetAllByUpgradePkgUrlId(upgradePkgUrlId *int) (resp []datatypes.Network_Gateway_VersionUpgrade, err error) { - params := []interface{}{ - upgradePkgUrlId, - } - err = r.Session.DoRequest("SoftLayer_Network_Gateway_VersionUpgrade", "getAllByUpgradePkgUrlId", params, &r.Options, &resp) - return -} - // no documentation yet func (r Network_Gateway_VersionUpgrade) GetAllUpgradesByGatewayId(gatewayId *int) (resp []datatypes.Network_Gateway_VersionUpgrade, err error) { params := []interface{}{ @@ -5826,175 +5784,6 @@ func (r Network_LBaaS_SSLCipher) GetObject() (resp datatypes.Network_LBaaS_SSLCi return } -// The global load balancer service has been deprecated and is no longer available. -// Deprecated: This function has been marked as deprecated. -type Network_LoadBalancer_Global_Account struct { - Session session.SLSession - Options sl.Options -} - -// GetNetworkLoadBalancerGlobalAccountService returns an instance of the Network_LoadBalancer_Global_Account SoftLayer service -func GetNetworkLoadBalancerGlobalAccountService(sess session.SLSession) Network_LoadBalancer_Global_Account { - return Network_LoadBalancer_Global_Account{Session: sess} -} - -func (r Network_LoadBalancer_Global_Account) Id(id int) Network_LoadBalancer_Global_Account { - r.Options.Id = &id - return r -} - -func (r Network_LoadBalancer_Global_Account) Mask(mask string) Network_LoadBalancer_Global_Account { - 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_LoadBalancer_Global_Account) Filter(filter string) Network_LoadBalancer_Global_Account { - r.Options.Filter = filter - return r -} - -func (r Network_LoadBalancer_Global_Account) Limit(limit int) Network_LoadBalancer_Global_Account { - r.Options.Limit = &limit - return r -} - -func (r Network_LoadBalancer_Global_Account) Offset(offset int) Network_LoadBalancer_Global_Account { - r.Options.Offset = &offset - return r -} - -// The global load balancer service has been deprecated and is no longer available. -// -// If your globally load balanced domain is hosted on the SoftLayer nameservers this method will add the required NS resource record to your DNS zone file and remove any A records that match the host portion of a global load balancer account hostname. -// Deprecated: This function has been marked as deprecated. -func (r Network_LoadBalancer_Global_Account) AddNsRecord() (resp bool, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "addNsRecord", nil, &r.Options, &resp) - return -} - -// The global load balancer service has been deprecated and is no longer available. -// -// Edit the properties of a global load balancer account by passing in a modified instance of the object. -// Deprecated: This function has been marked as deprecated. -func (r Network_LoadBalancer_Global_Account) EditObject(templateObject *datatypes.Network_LoadBalancer_Global_Account) (resp bool, err error) { - params := []interface{}{ - templateObject, - } - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "editObject", params, &r.Options, &resp) - return -} - -// Retrieve Your SoftLayer customer account. -func (r Network_LoadBalancer_Global_Account) GetAccount() (resp datatypes.Account, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getAccount", nil, &r.Options, &resp) - return -} - -// Retrieve The current billing item for a Global Load Balancer account. -func (r Network_LoadBalancer_Global_Account) GetBillingItem() (resp datatypes.Billing_Item, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getBillingItem", nil, &r.Options, &resp) - return -} - -// Retrieve The hosts in the load balancing pool for a global load balancer account. -func (r Network_LoadBalancer_Global_Account) GetHosts() (resp []datatypes.Network_LoadBalancer_Global_Host, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getHosts", nil, &r.Options, &resp) - return -} - -// Retrieve The load balance method of a global load balancer account -func (r Network_LoadBalancer_Global_Account) GetLoadBalanceType() (resp datatypes.Network_LoadBalancer_Global_Type, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getLoadBalanceType", nil, &r.Options, &resp) - return -} - -// Retrieve A flag indicating that the global load balancer is a managed resource. -func (r Network_LoadBalancer_Global_Account) GetManagedResourceFlag() (resp bool, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getManagedResourceFlag", nil, &r.Options, &resp) - return -} - -// The global load balancer service has been deprecated and is no longer available. -func (r Network_LoadBalancer_Global_Account) GetObject() (resp datatypes.Network_LoadBalancer_Global_Account, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getObject", nil, &r.Options, &resp) - return -} - -// The global load balancer service has been deprecated and is no longer available. -// -// If your globally load balanced domain is hosted on the SoftLayer nameservers this method will remove the NS resource record from your DNS zone file. -// Deprecated: This function has been marked as deprecated. -func (r Network_LoadBalancer_Global_Account) RemoveNsRecord() (resp bool, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "removeNsRecord", nil, &r.Options, &resp) - return -} - -// The global load balancer service has been deprecated and is no longer available. -// Deprecated: This function has been marked as deprecated. -type Network_LoadBalancer_Global_Host struct { - Session session.SLSession - Options sl.Options -} - -// GetNetworkLoadBalancerGlobalHostService returns an instance of the Network_LoadBalancer_Global_Host SoftLayer service -func GetNetworkLoadBalancerGlobalHostService(sess session.SLSession) Network_LoadBalancer_Global_Host { - return Network_LoadBalancer_Global_Host{Session: sess} -} - -func (r Network_LoadBalancer_Global_Host) Id(id int) Network_LoadBalancer_Global_Host { - r.Options.Id = &id - return r -} - -func (r Network_LoadBalancer_Global_Host) Mask(mask string) Network_LoadBalancer_Global_Host { - 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_LoadBalancer_Global_Host) Filter(filter string) Network_LoadBalancer_Global_Host { - r.Options.Filter = filter - return r -} - -func (r Network_LoadBalancer_Global_Host) Limit(limit int) Network_LoadBalancer_Global_Host { - r.Options.Limit = &limit - return r -} - -func (r Network_LoadBalancer_Global_Host) Offset(offset int) Network_LoadBalancer_Global_Host { - r.Options.Offset = &offset - return r -} - -// The global load balancer service has been deprecated and is no longer available. -// -// Remove a host from the load balancing pool of a global load balancer account. -// Deprecated: This function has been marked as deprecated. -func (r Network_LoadBalancer_Global_Host) DeleteObject() (resp bool, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Host", "deleteObject", nil, &r.Options, &resp) - return -} - -// Retrieve The global load balancer account a host belongs to. -func (r Network_LoadBalancer_Global_Host) GetLoadBalancerAccount() (resp datatypes.Network_LoadBalancer_Global_Account, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Host", "getLoadBalancerAccount", nil, &r.Options, &resp) - return -} - -// The global load balancer service has been deprecated and is no longer available. -func (r Network_LoadBalancer_Global_Host) GetObject() (resp datatypes.Network_LoadBalancer_Global_Host, err error) { - err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Host", "getObject", nil, &r.Options, &resp) - return -} - // The SoftLayer_Network_LoadBalancer_Service data type contains all the information relating to a specific service (destination) on a particular load balancer. // // Information retained on the object itself is the the source and destination of the service, routing type, weight, and whether or not the service is currently enabled. diff --git a/services/network_test.go b/services/network_test.go index 65d1685..5f738c5 100644 --- a/services/network_test.go +++ b/services/network_test.go @@ -56,6 +56,13 @@ var _ = Describe("Network Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Network::enableVrf", func() { + It("API Call Test", func() { + _, err := sl_service.EnableVrf() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Network::isConnectedToPrivateEndpointService", func() { It("API Call Test", func() { _, err := sl_service.IsConnectedToPrivateEndpointService() @@ -3428,34 +3435,6 @@ var _ = Describe("Network Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) - Context("SoftLayer_Network_Gateway::changeGatewayVersion", func() { - It("API Call Test", func() { - _, err := sl_service.ChangeGatewayVersion(nil, nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Gateway::checkAccountWhiteList", func() { - It("API Call Test", func() { - _, err := sl_service.CheckAccountWhiteList(nil, nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Gateway::createObject", func() { - It("API Call Test", func() { - _, err := sl_service.CreateObject(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Gateway::editObject", func() { - It("API Call Test", func() { - _, err := sl_service.EditObject(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Network_Gateway::forceRebuildCluster", func() { It("API Call Test", func() { _, err := sl_service.ForceRebuildCluster(nil) @@ -3596,13 +3575,6 @@ var _ = Describe("Network Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) - Context("SoftLayer_Network_Gateway::isAccountWhiteListed", func() { - It("API Call Test", func() { - _, err := sl_service.IsAccountWhiteListed(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Network_Gateway::isLicenseServerAllowed", func() { It("API Call Test", func() { _, err := sl_service.IsLicenseServerAllowed(nil) @@ -3610,13 +3582,6 @@ var _ = Describe("Network Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) - Context("SoftLayer_Network_Gateway::isRollbackAllowed", func() { - It("API Call Test", func() { - _, err := sl_service.IsRollbackAllowed() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Network_Gateway::manageLicenses", func() { It("API Call Test", func() { _, err := sl_service.ManageLicenses(nil, nil) @@ -3963,13 +3928,6 @@ var _ = Describe("Network Tests", func() { Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) }) }) - Context("SoftLayer_Network_Gateway_VersionUpgrade::getAllByUpgradePkgUrlId", func() { - It("API Call Test", func() { - _, err := sl_service.GetAllByUpgradePkgUrlId(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Network_Gateway_VersionUpgrade::getAllUpgradesByGatewayId", func() { It("API Call Test", func() { _, err := sl_service.GetAllUpgradesByGatewayId(nil) @@ -4969,150 +4927,6 @@ var _ = Describe("Network Tests", func() { }) }) - Context("Testing SoftLayer_Network_LoadBalancer_Global_Account service", func() { - var sl_service services.Network_LoadBalancer_Global_Account - BeforeEach(func() { - sl_service = services.GetNetworkLoadBalancerGlobalAccountService(slsession) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account Set Options", func() { - It("Set Options properly", func() { - t_id := 1234 - t_filter := "{'testFilter':{'test'}}" - t_limit := 100 - t_offset := 5 - sl_service = sl_service.Id(t_id).Filter(t_filter).Offset(t_offset).Limit(t_limit) - Expect(sl_service.Options.Id).To(HaveValue(Equal(t_id))) - Expect(sl_service.Options.Filter).To(HaveValue(Equal(t_filter))) - Expect(sl_service.Options.Limit).To(HaveValue(Equal(t_limit))) - Expect(sl_service.Options.Offset).To(HaveValue(Equal(t_offset))) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account Set Mask", func() { - It("Set Options properly", func() { - t_mask1 := "mask[test,test2]" - sl_service = sl_service.Mask(t_mask1) - Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) - // Mask("test,test2") should set the mask to be "mask[test,test2]" aka t_mask1 - sl_service = sl_service.Mask("test,test2") - Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::addNsRecord", func() { - It("API Call Test", func() { - _, err := sl_service.AddNsRecord() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::editObject", func() { - It("API Call Test", func() { - _, err := sl_service.EditObject(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::getAccount", func() { - It("API Call Test", func() { - _, err := sl_service.GetAccount() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::getBillingItem", func() { - It("API Call Test", func() { - _, err := sl_service.GetBillingItem() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::getHosts", func() { - It("API Call Test", func() { - _, err := sl_service.GetHosts() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::getLoadBalanceType", func() { - It("API Call Test", func() { - _, err := sl_service.GetLoadBalanceType() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::getManagedResourceFlag", func() { - It("API Call Test", func() { - _, err := sl_service.GetManagedResourceFlag() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::getObject", func() { - It("API Call Test", func() { - _, err := sl_service.GetObject() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Account::removeNsRecord", func() { - It("API Call Test", func() { - _, err := sl_service.RemoveNsRecord() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - }) - - Context("Testing SoftLayer_Network_LoadBalancer_Global_Host service", func() { - var sl_service services.Network_LoadBalancer_Global_Host - BeforeEach(func() { - sl_service = services.GetNetworkLoadBalancerGlobalHostService(slsession) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Host Set Options", func() { - It("Set Options properly", func() { - t_id := 1234 - t_filter := "{'testFilter':{'test'}}" - t_limit := 100 - t_offset := 5 - sl_service = sl_service.Id(t_id).Filter(t_filter).Offset(t_offset).Limit(t_limit) - Expect(sl_service.Options.Id).To(HaveValue(Equal(t_id))) - Expect(sl_service.Options.Filter).To(HaveValue(Equal(t_filter))) - Expect(sl_service.Options.Limit).To(HaveValue(Equal(t_limit))) - Expect(sl_service.Options.Offset).To(HaveValue(Equal(t_offset))) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Host Set Mask", func() { - It("Set Options properly", func() { - t_mask1 := "mask[test,test2]" - sl_service = sl_service.Mask(t_mask1) - Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) - // Mask("test,test2") should set the mask to be "mask[test,test2]" aka t_mask1 - sl_service = sl_service.Mask("test,test2") - Expect(sl_service.Options.Mask).To(HaveValue(Equal(t_mask1))) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Host::deleteObject", func() { - It("API Call Test", func() { - _, err := sl_service.DeleteObject() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Host::getLoadBalancerAccount", func() { - It("API Call Test", func() { - _, err := sl_service.GetLoadBalancerAccount() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_LoadBalancer_Global_Host::getObject", func() { - It("API Call Test", func() { - _, err := sl_service.GetObject() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - }) - Context("Testing SoftLayer_Network_LoadBalancer_Service service", func() { var sl_service services.Network_LoadBalancer_Service BeforeEach(func() { diff --git a/services/virtual.go b/services/virtual.go index ab5b469..11cd1fd 100644 --- a/services/virtual.go +++ b/services/virtual.go @@ -1928,6 +1928,13 @@ func (r Virtual_Guest) RebootSoft() (resp bool, err error) { return } +// no documentation yet +func (r Virtual_Guest) ReconfigureConsole() (err error) { + var resp datatypes.Void + err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "reconfigureConsole", nil, &r.Options, &resp) + return +} + // Create a transaction to perform an OS reload func (r Virtual_Guest) ReloadCurrentOperatingSystemConfiguration() (resp datatypes.Provisioning_Version1_Transaction, err error) { err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "reloadCurrentOperatingSystemConfiguration", nil, &r.Options, &resp) diff --git a/services/virtual_test.go b/services/virtual_test.go index 7ee749f..556f18a 100644 --- a/services/virtual_test.go +++ b/services/virtual_test.go @@ -1670,6 +1670,13 @@ var _ = Describe("Virtual Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Virtual_Guest::reconfigureConsole", func() { + It("API Call Test", func() { + err := sl_service.ReconfigureConsole() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_Virtual_Guest::reloadCurrentOperatingSystemConfiguration", func() { It("API Call Test", func() { _, err := sl_service.ReloadCurrentOperatingSystemConfiguration()