From 3319f58743a041b819035dc8594677c0131e91b8 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 6 Jun 2024 17:18:22 -0500 Subject: [PATCH] 20240606 updates --- .secrets.baseline | 12 +-- datatypes/hardware.go | 6 ++ datatypes/location.go | 9 +-- datatypes/network.go | 59 +-------------- datatypes/user.go | 29 +++++++ services/account.go | 6 +- services/hardware.go | 6 ++ services/hardware_test.go | 7 ++ services/location.go | 14 +--- services/location_test.go | 14 ---- services/network.go | 154 -------------------------------------- services/network_test.go | 137 --------------------------------- services/user.go | 64 ++++++++++++++++ services/user_test.go | 58 ++++++++++++++ 14 files changed, 183 insertions(+), 392 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 15cea32..358a8d6 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2024-05-23T19:37:19Z", + "generated_at": "2024-06-06T22:18:14Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -126,7 +126,7 @@ "hashed_secret": "319f96013e95ce7556aa082a9dd58dce40aeff0f", "is_secret": false, "is_verified": false, - "line_number": 1877, + "line_number": 1740, "type": "Secret Keyword", "verified_result": null }, @@ -134,7 +134,7 @@ "hashed_secret": "fa9250fd74ad6c9f6737049b5bd842709fbf4ae3", "is_secret": false, "is_verified": false, - "line_number": 1884, + "line_number": 1747, "type": "Secret Keyword", "verified_result": null }, @@ -142,7 +142,7 @@ "hashed_secret": "bf9130647c179bd2b6992bcf2db4560b91bc513d", "is_secret": false, "is_verified": false, - "line_number": 1891, + "line_number": 1754, "type": "Secret Keyword", "verified_result": null }, @@ -150,7 +150,7 @@ "hashed_secret": "0f39e6d6c8aafa1e3e723d1b06aef02ead75b908", "is_secret": false, "is_verified": false, - "line_number": 1898, + "line_number": 1761, "type": "Secret Keyword", "verified_result": null }, @@ -158,7 +158,7 @@ "hashed_secret": "5487abf5507e25b18b47a3e8cd1ecfdea8c0e9e9", "is_secret": false, "is_verified": false, - "line_number": 1905, + "line_number": 1768, "type": "Secret Keyword", "verified_result": null } diff --git a/datatypes/hardware.go b/datatypes/hardware.go index 14ffae2..2d8e896 100644 --- a/datatypes/hardware.go +++ b/datatypes/hardware.go @@ -1190,6 +1190,12 @@ type Hardware_Component_Model struct { // The model number or model description of a hardware component model. Version *string `json:"version,omitempty" xmlrpc:"version,omitempty"` + + // A count of + VmwareQualifiedFirmwareCount *uint `json:"vmwareQualifiedFirmwareCount,omitempty" xmlrpc:"vmwareQualifiedFirmwareCount,omitempty"` + + // no documentation yet + VmwareQualifiedFirmwares []Hardware_Component_Firmware `json:"vmwareQualifiedFirmwares,omitempty" xmlrpc:"vmwareQualifiedFirmwares,omitempty"` } // no documentation yet diff --git a/datatypes/location.go b/datatypes/location.go index ea5f0c3..a304d49 100644 --- a/datatypes/location.go +++ b/datatypes/location.go @@ -13,7 +13,7 @@ package datatypes -// Every piece of hardware and network connection owned by SoftLayer is tracked physically by location and stored in the SoftLayer_Location data type. SoftLayer locations exist in parent/child relationships, a convenient way to track equipment from it's city, datacenter, server room, rack, then slot. Network backbones are tied to datacenters only, not to a room, rack, or slot. +// Every piece of hardware and network connection owned by SoftLayer is tracked physically by location and stored in the SoftLayer_Location data type. SoftLayer locations exist in parent/child relationships, a convenient way to track equipment from it's city, datacenter, server room, rack, then slot. type Location struct { Entity @@ -23,13 +23,6 @@ type Location struct { // no documentation yet ActivePresaleEvents []Sales_Presale_Event `json:"activePresaleEvents,omitempty" xmlrpc:"activePresaleEvents,omitempty"` - // A count of - 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. BnppCompliantFlag *bool `json:"bnppCompliantFlag,omitempty" xmlrpc:"bnppCompliantFlag,omitempty"` diff --git a/datatypes/network.go b/datatypes/network.go index 3c1164b..476de18 100644 --- a/datatypes/network.go +++ b/datatypes/network.go @@ -557,63 +557,6 @@ type Network_Application_Delivery_Controller_Type struct { Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` } -// 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. -type Network_Backbone struct { - Entity - - // The numeric portion of the bandwidth capacity of a SoftLayer backbone. For instance, if a backbone is rated at "1 GigE" capacity then the capacity property of the backbone is 1. - Capacity *int `json:"capacity,omitempty" xmlrpc:"capacity,omitempty"` - - // 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"` - - // [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"` - - // [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"` - - // [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. - NetworkComponentId *int `json:"networkComponentId,omitempty" xmlrpc:"networkComponentId,omitempty"` - - // Whether a SoftLayer backbone connects to the public Internet, to the private network, or connecting the private networks of SoftLayer's datacenters. Type is either the string "public", "private", or "private-interconnect". - Type *string `json:"type,omitempty" xmlrpc:"type,omitempty"` -} - -// no documentation yet -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 - DependentLocationId *int `json:"dependentLocationId,omitempty" xmlrpc:"dependentLocationId,omitempty"` - - // no documentation yet - 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 - SourceLocationId *int `json:"sourceLocationId,omitempty" xmlrpc:"sourceLocationId,omitempty"` -} - // The SoftLayer_Network_Bandwidth_Usage data type contains specific information relating to bandwidth utilization at a specific point in time on a given network interface. type Network_Bandwidth_Usage struct { Entity @@ -3456,6 +3399,7 @@ type Network_Service_Health struct { CreateDate *Time `json:"createDate,omitempty" xmlrpc:"createDate,omitempty"` // A service's location. + // Deprecated: This function has been marked as deprecated. Location *Location `json:"location,omitempty" xmlrpc:"location,omitempty"` // A service's location identifier. @@ -3465,6 +3409,7 @@ type Network_Service_Health struct { ModifyDate *Time `json:"modifyDate,omitempty" xmlrpc:"modifyDate,omitempty"` // The status portion of a service/status relationship. + // Deprecated: This function has been marked as deprecated. Status *Network_Service_Health_Status `json:"status,omitempty" xmlrpc:"status,omitempty"` // A service's status identifier. diff --git a/datatypes/user.go b/datatypes/user.go index c9bb026..13b0e90 100644 --- a/datatypes/user.go +++ b/datatypes/user.go @@ -1135,6 +1135,12 @@ type User_Permission_Action struct { // no documentation yet CreateDate *Time `json:"createDate,omitempty" xmlrpc:"createDate,omitempty"` + // no documentation yet + Department *User_Permission_Department `json:"department,omitempty" xmlrpc:"department,omitempty"` + + // no documentation yet + DepartmentId *int `json:"departmentId,omitempty" xmlrpc:"departmentId,omitempty"` + // no documentation yet Description *string `json:"description,omitempty" xmlrpc:"description,omitempty"` @@ -1155,6 +1161,29 @@ type User_Permission_Action struct { Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` } +// no documentation yet +type User_Permission_Department struct { + Entity + + // Department description + Description *string `json:"description,omitempty" xmlrpc:"description,omitempty"` + + // Department primary identifier + Id *int `json:"id,omitempty" xmlrpc:"id,omitempty"` + + // Department key name + KeyName *string `json:"keyName,omitempty" xmlrpc:"keyName,omitempty"` + + // Department readable name + Name *string `json:"name,omitempty" xmlrpc:"name,omitempty"` + + // A count of + PermissionCount *uint `json:"permissionCount,omitempty" xmlrpc:"permissionCount,omitempty"` + + // no documentation yet + Permissions []User_Permission_Action `json:"permissions,omitempty" xmlrpc:"permissions,omitempty"` +} + // The SoftLayer_User_Permission_Group data type contains local attributes to identify and describe the permission groups that have been created within IMS. These includes a name, description, and account id. Permission groups are defined specifically for a single [[SoftLayer_Account]]. // // It also contains relational attributes that indicate what SoftLayer_User_Permission_Action objects belong to a particular group, and what SoftLayer_User_Permission_Role objects the group is linked. diff --git a/services/account.go b/services/account.go index 9801d1a..1ace3e0 100644 --- a/services/account.go +++ b/services/account.go @@ -3504,7 +3504,7 @@ func (r Account_Lockdown_Request) CancelRequest() (err error) { return } -// 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. +// Takes the original lockdown request ID. The account will be disabled immediately. All hardware will be reclaimed and all accounts permanently disabled. func (r Account_Lockdown_Request) DisableLockedAccount(disableDate *string, statusChangeReasonKeyName *string) (resp int, err error) { params := []interface{}{ disableDate, @@ -3514,7 +3514,7 @@ func (r Account_Lockdown_Request) DisableLockedAccount(disableDate *string, stat return } -// Takes an account ID and an optional disconnect date. If no disconnect date is passed into the API call, the account disconnection will happen immediately. Otherwise, the account disconnection will happen on the date given. A brand account request ID will be returned and will then be updated when the disconnection occurs. +// Takes an account ID. Note the disconnection will happen immediately. A brand account request ID will be returned and will then be updated when the disconnection occurs. func (r Account_Lockdown_Request) DisconnectCompute(accountId *int, disconnectDate *string) (resp int, err error) { params := []interface{}{ accountId, @@ -3539,7 +3539,7 @@ func (r Account_Lockdown_Request) GetObject() (resp datatypes.Account_Lockdown_R return } -// Takes the original disconnected lockdown event ID, and an optional reconnect date. If no reconnect date is passed with the API call, the account reconnection will happen immediately. Otherwise, the account reconnection will happen on the date given. The associated lockdown event will be unlocked and closed at that time. +// Takes the original disconnected lockdown request ID. The account reconnection will happen immediately. The associated lockdown event will be unlocked and closed at that time. func (r Account_Lockdown_Request) ReconnectCompute(reconnectDate *string) (resp int, err error) { params := []interface{}{ reconnectDate, diff --git a/services/hardware.go b/services/hardware.go index 19da233..71e5e64 100644 --- a/services/hardware.go +++ b/services/hardware.go @@ -1879,6 +1879,12 @@ func (r Hardware_Component_Model) GetValidAttributeTypes() (resp []datatypes.Har return } +// Retrieve +func (r Hardware_Component_Model) GetVmwareQualifiedFirmwares() (resp []datatypes.Hardware_Component_Firmware, err error) { + err = r.Session.DoRequest("SoftLayer_Hardware_Component_Model", "getVmwareQualifiedFirmwares", nil, &r.Options, &resp) + return +} + // The SoftLayer_Hardware_Component_Partition_OperatingSystem data type contains general information relating to a single SoftLayer Operating System Partition Template. type Hardware_Component_Partition_OperatingSystem struct { Session session.SLSession diff --git a/services/hardware_test.go b/services/hardware_test.go index bd4e385..e396c7e 100644 --- a/services/hardware_test.go +++ b/services/hardware_test.go @@ -1646,6 +1646,13 @@ var _ = Describe("Hardware Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_Hardware_Component_Model::getVmwareQualifiedFirmwares", func() { + It("API Call Test", func() { + _, err := sl_service.GetVmwareQualifiedFirmwares() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) }) Context("Testing SoftLayer_Hardware_Component_Partition_OperatingSystem service", func() { diff --git a/services/location.go b/services/location.go index 0b48ee7..288da2d 100644 --- a/services/location.go +++ b/services/location.go @@ -22,7 +22,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -// Every piece of hardware and network connection owned by SoftLayer is tracked physically by location and stored in the SoftLayer_Location data type. SoftLayer locations exist in parent/child relationships, a convenient way to track equipment from it's city, datacenter, server room, rack, then slot. Network backbones are tied to datacenters only, not to a room, rack, or slot. +// Every piece of hardware and network connection owned by SoftLayer is tracked physically by location and stored in the SoftLayer_Location data type. SoftLayer locations exist in parent/child relationships, a convenient way to track equipment from it's city, datacenter, server room, rack, then slot. type Location struct { Session session.SLSession Options sl.Options @@ -74,12 +74,6 @@ func (r Location) GetAvailableObjectStorageDatacenters() (resp []datatypes.Locat return } -// Retrieve -func (r Location) GetBackboneDependents() (resp []datatypes.Network_Backbone_Location_Dependent, err error) { - err = r.Session.DoRequest("SoftLayer_Location", "getBackboneDependents", nil, &r.Options, &resp) - return -} - // Retrieve A flag indicating whether or not the datacenter/location is BNPP compliant. func (r Location) GetBnppCompliantFlag() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Location", "getBnppCompliantFlag", nil, &r.Options, &resp) @@ -270,12 +264,6 @@ func (r Location_Datacenter) GetAvailableObjectStorageDatacenters() (resp []data return } -// Retrieve -func (r Location_Datacenter) GetBackboneDependents() (resp []datatypes.Network_Backbone_Location_Dependent, err error) { - err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getBackboneDependents", nil, &r.Options, &resp) - return -} - // Retrieve func (r Location_Datacenter) GetBackendHardwareRouters() (resp []datatypes.Hardware, err error) { err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getBackendHardwareRouters", nil, &r.Options, &resp) diff --git a/services/location_test.go b/services/location_test.go index 8bae8fe..934e199 100644 --- a/services/location_test.go +++ b/services/location_test.go @@ -56,13 +56,6 @@ var _ = Describe("Location Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) - Context("SoftLayer_Location::getBackboneDependents", func() { - It("API Call Test", func() { - _, err := sl_service.GetBackboneDependents() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Location::getBnppCompliantFlag", func() { It("API Call Test", func() { _, err := sl_service.GetBnppCompliantFlag() @@ -268,13 +261,6 @@ var _ = Describe("Location Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) - Context("SoftLayer_Location_Datacenter::getBackboneDependents", func() { - It("API Call Test", func() { - _, err := sl_service.GetBackboneDependents() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) Context("SoftLayer_Location_Datacenter::getBackendHardwareRouters", func() { It("API Call Test", func() { _, err := sl_service.GetBackendHardwareRouters() diff --git a/services/network.go b/services/network.go index 86d9540..4a5635d 100644 --- a/services/network.go +++ b/services/network.go @@ -1264,160 +1264,6 @@ func (r Network_Application_Delivery_Controller_LoadBalancer_VirtualServer) Stop return } -// 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 -} - -// GetNetworkBackboneService returns an instance of the Network_Backbone SoftLayer service -func GetNetworkBackboneService(sess session.SLSession) Network_Backbone { - return Network_Backbone{Session: sess} -} - -func (r Network_Backbone) Id(id int) Network_Backbone { - r.Options.Id = &id - return r -} - -func (r Network_Backbone) Mask(mask string) Network_Backbone { - 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_Backbone) Filter(filter string) Network_Backbone { - r.Options.Filter = filter - return r -} - -func (r Network_Backbone) Limit(limit int) Network_Backbone { - r.Options.Limit = &limit - return r -} - -func (r Network_Backbone) Offset(offset int) Network_Backbone { - r.Options.Offset = &offset - return r -} - -// Retrieve a list of all SoftLayer backbone connections. Use this method if you need all backbones or don't know the id number of a specific backbone. -func (r Network_Backbone) GetAllBackbones() (resp []datatypes.Network_Backbone, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Backbone", "getAllBackbones", nil, &r.Options, &resp) - return -} - -// Retrieve a list of all SoftLayer backbone connections for a location name. -func (r Network_Backbone) GetBackbonesForLocationName(locationName *string) (resp []datatypes.Network_Backbone, err error) { - params := []interface{}{ - locationName, - } - err = r.Session.DoRequest("SoftLayer_Network_Backbone", "getBackbonesForLocationName", params, &r.Options, &resp) - return -} - -// 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 [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 [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 -} - -// Retrieve an individual SoftLayer_Network_Backbone record. Use the getAllBackbones() method to retrieve a list of all SoftLayer network backbones. -func (r Network_Backbone) GetObject() (resp datatypes.Network_Backbone, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Backbone", "getObject", nil, &r.Options, &resp) - return -} - -// no documentation yet -// Deprecated: This function has been marked as deprecated. -type Network_Backbone_Location_Dependent struct { - Session session.SLSession - Options sl.Options -} - -// GetNetworkBackboneLocationDependentService returns an instance of the Network_Backbone_Location_Dependent SoftLayer service -func GetNetworkBackboneLocationDependentService(sess session.SLSession) Network_Backbone_Location_Dependent { - return Network_Backbone_Location_Dependent{Session: sess} -} - -func (r Network_Backbone_Location_Dependent) Id(id int) Network_Backbone_Location_Dependent { - r.Options.Id = &id - return r -} - -func (r Network_Backbone_Location_Dependent) Mask(mask string) Network_Backbone_Location_Dependent { - 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_Backbone_Location_Dependent) Filter(filter string) Network_Backbone_Location_Dependent { - r.Options.Filter = filter - return r -} - -func (r Network_Backbone_Location_Dependent) Limit(limit int) Network_Backbone_Location_Dependent { - r.Options.Limit = &limit - return r -} - -func (r Network_Backbone_Location_Dependent) Offset(offset int) Network_Backbone_Location_Dependent { - r.Options.Offset = &offset - return r -} - -// no documentation yet -func (r Network_Backbone_Location_Dependent) GetAllObjects() (resp []datatypes.Network_Backbone_Location_Dependent, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Backbone_Location_Dependent", "getAllObjects", nil, &r.Options, &resp) - return -} - -// Retrieve -func (r Network_Backbone_Location_Dependent) GetDependentLocation() (resp datatypes.Location, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Backbone_Location_Dependent", "getDependentLocation", nil, &r.Options, &resp) - return -} - -// no documentation yet -func (r Network_Backbone_Location_Dependent) GetObject() (resp datatypes.Network_Backbone_Location_Dependent, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Backbone_Location_Dependent", "getObject", nil, &r.Options, &resp) - return -} - -// no documentation yet -func (r Network_Backbone_Location_Dependent) GetSourceDependentsByName(locationName *string) (resp datatypes.Location, err error) { - params := []interface{}{ - locationName, - } - err = r.Session.DoRequest("SoftLayer_Network_Backbone_Location_Dependent", "getSourceDependentsByName", params, &r.Options, &resp) - return -} - -// Retrieve -func (r Network_Backbone_Location_Dependent) GetSourceLocation() (resp datatypes.Location, err error) { - err = r.Session.DoRequest("SoftLayer_Network_Backbone_Location_Dependent", "getSourceLocation", nil, &r.Options, &resp) - return -} - // The SoftLayer_Network_Bandwidth_Version1_Allotment class provides methods and data structures necessary to work with an array of hardware objects associated with a single Bandwidth Pooling. type Network_Bandwidth_Version1_Allotment struct { Session session.SLSession diff --git a/services/network_test.go b/services/network_test.go index 5f738c5..1dfabcf 100644 --- a/services/network_test.go +++ b/services/network_test.go @@ -1125,143 +1125,6 @@ var _ = Describe("Network Tests", func() { }) }) - Context("Testing SoftLayer_Network_Backbone service", func() { - var sl_service services.Network_Backbone - BeforeEach(func() { - sl_service = services.GetNetworkBackboneService(slsession) - }) - Context("SoftLayer_Network_Backbone 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_Backbone 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_Backbone::getAllBackbones", func() { - It("API Call Test", func() { - _, err := sl_service.GetAllBackbones() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone::getBackbonesForLocationName", func() { - It("API Call Test", func() { - _, err := sl_service.GetBackbonesForLocationName(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone::getHealth", func() { - It("API Call Test", func() { - _, err := sl_service.GetHealth() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone::getLocation", func() { - It("API Call Test", func() { - _, err := sl_service.GetLocation() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone::getNetworkComponent", func() { - It("API Call Test", func() { - _, err := sl_service.GetNetworkComponent() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone::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_Backbone_Location_Dependent service", func() { - var sl_service services.Network_Backbone_Location_Dependent - BeforeEach(func() { - sl_service = services.GetNetworkBackboneLocationDependentService(slsession) - }) - Context("SoftLayer_Network_Backbone_Location_Dependent 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_Backbone_Location_Dependent 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_Backbone_Location_Dependent::getAllObjects", func() { - It("API Call Test", func() { - _, err := sl_service.GetAllObjects() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone_Location_Dependent::getDependentLocation", func() { - It("API Call Test", func() { - _, err := sl_service.GetDependentLocation() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone_Location_Dependent::getObject", func() { - It("API Call Test", func() { - _, err := sl_service.GetObject() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone_Location_Dependent::getSourceDependentsByName", func() { - It("API Call Test", func() { - _, err := sl_service.GetSourceDependentsByName(nil) - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - Context("SoftLayer_Network_Backbone_Location_Dependent::getSourceLocation", func() { - It("API Call Test", func() { - _, err := sl_service.GetSourceLocation() - Expect(err).To(Succeed()) - Expect(slsession.DoRequestCallCount()).To(Equal(1)) - }) - }) - }) - Context("Testing SoftLayer_Network_Bandwidth_Version1_Allotment service", func() { var sl_service services.Network_Bandwidth_Version1_Allotment BeforeEach(func() { diff --git a/services/user.go b/services/user.go index a411f49..38ef3c7 100644 --- a/services/user.go +++ b/services/user.go @@ -4870,12 +4870,76 @@ func (r User_Permission_Action) GetAllObjects() (resp []datatypes.User_Permissio return } +// Retrieve +func (r User_Permission_Action) GetDepartment() (resp datatypes.User_Permission_Department, err error) { + err = r.Session.DoRequest("SoftLayer_User_Permission_Action", "getDepartment", nil, &r.Options, &resp) + return +} + // no documentation yet func (r User_Permission_Action) GetObject() (resp datatypes.User_Permission_Action, err error) { err = r.Session.DoRequest("SoftLayer_User_Permission_Action", "getObject", nil, &r.Options, &resp) return } +// no documentation yet +type User_Permission_Department struct { + Session session.SLSession + Options sl.Options +} + +// GetUserPermissionDepartmentService returns an instance of the User_Permission_Department SoftLayer service +func GetUserPermissionDepartmentService(sess session.SLSession) User_Permission_Department { + return User_Permission_Department{Session: sess} +} + +func (r User_Permission_Department) Id(id int) User_Permission_Department { + r.Options.Id = &id + return r +} + +func (r User_Permission_Department) Mask(mask string) User_Permission_Department { + 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 User_Permission_Department) Filter(filter string) User_Permission_Department { + r.Options.Filter = filter + return r +} + +func (r User_Permission_Department) Limit(limit int) User_Permission_Department { + r.Options.Limit = &limit + return r +} + +func (r User_Permission_Department) Offset(offset int) User_Permission_Department { + r.Options.Offset = &offset + return r +} + +// no documentation yet +func (r User_Permission_Department) GetAllObjects() (resp []datatypes.User_Permission_Department, err error) { + err = r.Session.DoRequest("SoftLayer_User_Permission_Department", "getAllObjects", nil, &r.Options, &resp) + return +} + +// no documentation yet +func (r User_Permission_Department) GetObject() (resp datatypes.User_Permission_Department, err error) { + err = r.Session.DoRequest("SoftLayer_User_Permission_Department", "getObject", nil, &r.Options, &resp) + return +} + +// Retrieve +func (r User_Permission_Department) GetPermissions() (resp []datatypes.User_Permission_Action, err error) { + err = r.Session.DoRequest("SoftLayer_User_Permission_Department", "getPermissions", nil, &r.Options, &resp) + return +} + // The SoftLayer_User_Permission_Group data type contains local attributes to identify and describe the permission groups that have been created within IMS. These includes a name, description, and account id. Permission groups are defined specifically for a single [[SoftLayer_Account]]. // // It also contains relational attributes that indicate what SoftLayer_User_Permission_Action objects belong to a particular group, and what SoftLayer_User_Permission_Role objects the group is linked. diff --git a/services/user_test.go b/services/user_test.go index 40f4642..c922fd9 100644 --- a/services/user_test.go +++ b/services/user_test.go @@ -3921,6 +3921,13 @@ var _ = Describe("User Tests", func() { Expect(slsession.DoRequestCallCount()).To(Equal(1)) }) }) + Context("SoftLayer_User_Permission_Action::getDepartment", func() { + It("API Call Test", func() { + _, err := sl_service.GetDepartment() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) Context("SoftLayer_User_Permission_Action::getObject", func() { It("API Call Test", func() { _, err := sl_service.GetObject() @@ -3930,6 +3937,57 @@ var _ = Describe("User Tests", func() { }) }) + Context("Testing SoftLayer_User_Permission_Department service", func() { + var sl_service services.User_Permission_Department + BeforeEach(func() { + sl_service = services.GetUserPermissionDepartmentService(slsession) + }) + Context("SoftLayer_User_Permission_Department 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_User_Permission_Department 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_User_Permission_Department::getAllObjects", func() { + It("API Call Test", func() { + _, err := sl_service.GetAllObjects() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) + Context("SoftLayer_User_Permission_Department::getObject", func() { + It("API Call Test", func() { + _, err := sl_service.GetObject() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) + Context("SoftLayer_User_Permission_Department::getPermissions", func() { + It("API Call Test", func() { + _, err := sl_service.GetPermissions() + Expect(err).To(Succeed()) + Expect(slsession.DoRequestCallCount()).To(Equal(1)) + }) + }) + }) + Context("Testing SoftLayer_User_Permission_Group service", func() { var sl_service services.User_Permission_Group BeforeEach(func() {