diff --git a/conch/rackRoles.go b/conch/rackRoles.go index a767c8f..aee25ca 100644 --- a/conch/rackRoles.go +++ b/conch/rackRoles.go @@ -4,7 +4,7 @@ import "github.com/joyent/kosh/conch/types" // GetAllRackRoles (GET /rack_role) returns a list of all rack roles func (c *Client) GetAllRackRoles() (roles types.RackRoles, e error) { - _, e = c.RackRole().Receive(roles) + _, e = c.RackRole().Receive(&roles) return } @@ -17,14 +17,14 @@ func (c *Client) CreateRackRole(role types.RackRoleCreate) error { // GetRackRoleByName (GET /rack_role/:rack_role_id_or_name) // retrieves the rack role for the given name func (c *Client) GetRackRoleByName(name string) (role types.RackRole, e error) { - _, e = c.RackRole(name).Receive(role) + _, e = c.RackRole(name).Receive(&role) return } // GetRackRoleByID (GET /rack_role/:rack_role_id_or_name) retrieves the rack // role for the given UUID func (c *Client) GetRackRoleByID(id types.UUID) (role types.RackRole, e error) { - _, e = c.RackRole(id.String()).Receive(role) + _, e = c.RackRole(id.String()).Receive(&role) return } diff --git a/conch/rooms.go b/conch/rooms.go index bd403c3..58c987a 100644 --- a/conch/rooms.go +++ b/conch/rooms.go @@ -4,34 +4,34 @@ import "github.com/joyent/kosh/conch/types" // GetAllRooms (GET /room) returns a list of all datacenter rooms func (c *Client) GetAllRooms() (rooms types.DatacenterRoomsDetailed, e error) { - _, e = c.Room().Receive(rooms) + _, e = c.Room().Receive(&rooms) return } // CreateRoom (POST /room) creates a new datacenter room func (c *Client) CreateRoom(room types.DatacenterRoomCreate) error { - _, e := c.Room().Post(room).Send() + _, e := c.Room().Post(&room).Send() return e } // GetRoomByAlias (GET /room/:datacenter_room_id_or_alias) retrieves the // datacenter room with the given alias func (c *Client) GetRoomByAlias(alias string) (room types.DatacenterRoomDetailed, e error) { - _, e = c.Room(alias).Receive(room) + _, e = c.Room(alias).Receive(&room) return } // GetRoomByID (GET /room/:datacenter_room_id_or_alias) retrieves the // datacenter room with the given UUID func (c *Client) GetRoomByID(id types.UUID) (room types.DatacenterRoomDetailed, e error) { - _, e = c.Room(id.String()).Receive(room) + _, e = c.Room(id.String()).Receive(&room) return } // UpdateRoom (POST /room/:datacenter_room_id_or_alias) // updates the datacenter room with the given UUID func (c *Client) UpdateRoom(id types.UUID, room types.DatacenterRoomUpdate) error { - _, e := c.Room(id.String()).Post(room).Send() + _, e := c.Room(id.String()).Post(&room).Send() return e } @@ -45,21 +45,21 @@ func (c *Client) DeleteRoom(id types.UUID) error { // GetAllRoomRacks (GET /room/:datacenter_room_id_or_alias/rack) // returns a list of all racks in the room with the given UUID func (c *Client) GetAllRoomRacks(id types.UUID) (racks types.Racks, e error) { - _, e = c.Room(id.String()).Rack().Receive(racks) + _, e = c.Room(id.String()).Rack().Receive(&racks) return } // GetRoomRackByName (GET /room/:datacenter_room_id_or_alias/rack/:rack_id_or_name) // returns the specific rack with the given name in the room with the given UUID func (c *Client) GetRoomRackByName(id types.UUID, name string) (rack types.Rack, e error) { - _, e = c.Room(id.String()).Rack(name).Receive(rack) + _, e = c.Room(id.String()).Rack(name).Receive(&rack) return } // GetRoomRackByID (GET /room/:datacenter_room_id_or_alias/rack/:rack_id_or_name) // returns the specific rack with the given UUID in the room with the given UUID func (c *Client) GetRoomRackByID(roomID, rackID types.UUID) (rack types.Rack, e error) { - _, e = c.Room(roomID.String()).Rack(rackID.String()).Receive(rack) + _, e = c.Room(roomID.String()).Rack(rackID.String()).Receive(&rack) return } @@ -80,7 +80,7 @@ func (c *Client) DeleteRoomRack(roomID, rackID types.UUID) error { // GetRoomRackLayout (GET /room/:datacenter_room_id_or_alias/rack/:rack_id_or_name/layout) // get the rack layout for the rack in the given room func (c *Client) GetRoomRackLayout(roomID, rackID types.UUID) (rack types.RackLayouts, e error) { - _, e = c.Room(roomID.String()).Rack(roomID.String()).Layout().Receive(rack) + _, e = c.Room(roomID.String()).Rack(roomID.String()).Layout().Receive(&rack) return } @@ -94,7 +94,7 @@ func (c *Client) UpdateRoomRackLayout(roomID, rackID types.UUID, layout types.Ra // GetRoomRackAssignments (GET /room/:datacenter_room_id_or_alias/rack/:rack_id_or_name/assignment) // retrieve the rack assignments for the rack in the given room func (c *Client) GetRoomRackAssignments(roomID, rackID types.UUID) (rack types.RackAssignments, e error) { - _, e = c.Room(roomID.String()).Rack(rackID.String()).Assignment().Receive(rack) + _, e = c.Room(roomID.String()).Rack(rackID.String()).Assignment().Receive(&rack) return } @@ -136,14 +136,14 @@ func (c *Client) DeleteRoomRackLinks(roomID, rackID types.UUID, phase types.Rack // GetSingleRoomRackLayoutByRU (GET /room/:datacenter_room_id_or_alias/rack/:rack_id_or_name/layout/:layout_id_or_rack_unit_start) // get the rack layout for a single named RU in a rack in a room func (c *Client) GetSingleRoomRackLayoutByRU(roomID, rackID types.UUID, ru string) (rack types.RackLayout, e error) { - _, e = c.Room(roomID.String()).Rack(rackID.String()).Layout(ru).Receive(rack) + _, e = c.Room(roomID.String()).Rack(rackID.String()).Layout(ru).Receive(&rack) return } // GetSingleRoomRackLayoutByID (GET /room/:datacenter_room_id_or_alias/rack/:rack_id_or_name/layout/:layout_id_or_rack_unit_start) // get the rack layout for given UUID in a rack in a room func (c *Client) GetSingleRoomRackLayoutByID(roomID, rackID, layoutID types.UUID) (rack types.RackLayout, e error) { - _, e = c.Room(rackID.String()).Rack(rackID.String()).Layout(layoutID.String()).Receive(rack) + _, e = c.Room(rackID.String()).Rack(rackID.String()).Layout(layoutID.String()).Receive(&rack) return }