Documentation ¶
Index ¶
- Constants
- Variables
- func HandleAddLicenseSuccessfully(t *testing.T)
- func HandleCreateServerSuccessfully(t *testing.T)
- func HandleDeleteServerSuccessfully(t *testing.T)
- func HandleGetAddLicenseResultSuccessfully(t *testing.T)
- func HandleGetServerSuccessfully(t *testing.T)
- func HandleListServersDetailsSuccessfully(t *testing.T)
- func HandleListServersSuccessfully(t *testing.T)
Constants ¶
const AddLicenseRequest = `` /* 130-byte string literal not displayed */
const AddLicenseResponse = `
{
"job_id": "b4f888dc2b9d4c41bb769cbd"
}
`
const CreateRequest = `` /* 385-byte string literal not displayed */
CreateRequest provides the input to a Create request.
const CreateResponse = `` /* 477-byte string literal not displayed */
const GetAddLicenseResultRequest = `
{
"get-result-for-add-license-to-vm": {
"job_id": "b4f888dc2b9d4c41bb769cbd"
}
}
`
const GetAddLicenseResultResponse = `` /* 181-byte string literal not displayed */
const GetResult = `` /* 4666-byte string literal not displayed */
GetResult provides a Get result.
const ListDetailsResult = `` /* 9689-byte string literal not displayed */
ListDetailsResult provides a single page of Server results in details.
const ListResult = `` /* 1907-byte string literal not displayed */
ListResult provides a single page of Server results.
Variables ¶
var AddLicenseJob = servers.Job{ JobID: "b4f888dc2b9d4c41bb769cbd", Status: "COMPLETED", RequestedParam: servers.RequestedParam{ VmName: "Alice", LicenseTypes: []string{ "Windows Server", "SQL Server Standard 2014", }, }, }
var ExpectedServersDetailsSlice = []servers.Server{FirstServerDetail, SecondServerDetail}
ExpectedServersDetailsSlice is the slice of resources expected to be returned from ListDetailsResult.
var ExpectedServersSlice = []servers.Server{FirstServer, SecondServer}
ExpectedServersSlice is the slice of resources expected to be returned from ListResult.
var FirstServer = servers.Server{ ID: "194573e4-8f53-4ee4-806f-d9b2db74a380", Name: "GP2v1", Links: []servers.Link{ { Href: "https://dedicated-hypervisor-jp1-ecl.api.ntt.com/v1.0//v2/1bc271e7a8af4d988ff91612f5b122f8/servers/194573e4-8f53-4ee4-806f-d9b2db74a380", Rel: "self", }, { Href: "https://dedicated-hypervisor-jp1-ecl.api.ntt.com/v1.0//1bc271e7a8af4d988ff91612f5b122f8/servers/194573e4-8f53-4ee4-806f-d9b2db74a380", Rel: "bookmark", }, }, BaremetalServer: servers.BaremetalServer{ ID: "621b56e4-4aae-4de5-86a0-8ffeeda6a00b", Name: "GP2v1", Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/v2/1bc271e7a8af4d988ff91612f5b122f8/servers/621b56e4-4aae-4de5-86a0-8ffeeda6a00b", Rel: "self", }, { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/servers/621b56e4-4aae-4de5-86a0-8ffeeda6a00b", Rel: "bookmark", }, }, }, }
FirstServer is the first resource in the List request.
var FirstServerDetail = servers.Server{ ID: "194573e4-8f53-4ee4-806f-d9b2db74a380", Name: "GP2v1", ImageRef: "293063f6-8986-4b79-becd-7a6d28794bb8", Description: nil, Status: "ACTIVE", HypervisorType: "vsphere_esxi", BaremetalServer: servers.BaremetalServer{ PowerState: "RUNNING", TaskState: "None", VMState: "ACTIVE", AvailabilityZone: "groupb", Created: time.Date(2019, 10, 18, 7, 42, 35, 0, time.UTC), Flavor: servers.Flavor{ ID: "303b4993-cf29-4301-abd0-99512b5413a5", Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/flavors/303b4993-cf29-4301-abd0-99512b5413a5", Rel: "bookmark", }, }, }, ID: "621b56e4-4aae-4de5-86a0-8ffeeda6a00b", Image: servers.Image{ ID: "02441adc-0d9a-4e9d-b359-ce23413e7ea7", Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/images/02441adc-0d9a-4e9d-b359-ce23413e7ea7", Rel: "bookmark", }, }, }, Metadata: map[string]string{}, Name: "GP2v1", Progress: 100, Status: "ACTIVE", TenantID: "1bc271e7a8af4d988ff91612f5b122f8", Updated: time.Date(2019, 10, 18, 7, 44, 18, 0, time.UTC), UserID: "55891ce6a3cb4bb0833514667d67288c", NicPhysicalPorts: []servers.NicPhysicalPort{ { ID: "b49c0624-e89a-469f-8c90-7a27ee1f61cb", MACAddr: "8C:DC:D4:B7:41:48", Plane: "DATA", NetworkPhysicalPortID: "4cfbe3b2-a502-485f-82fa-a0949396e567", HardwareID: "8e1e2fe0-60a7-4211-a891-80e808426708", AttachedPorts: []servers.Port{ { NetworkID: "4a59f728-3920-4b71-ae54-d0d5c14ba04b", PortID: "8808acc2-d930-40fb-b382-ce7074baef83", FixedIPs: []servers.FixedIP{ { SubnetID: "b87d9c85-af5c-403d-a49a-55a6ab0a36d2", IPAddress: "169.254.0.11", }, }, }, { NetworkID: "722f9e4f-39f8-406a-b98c-5fbd5689b89a", PortID: "9d3baa16-e0e5-4e50-9677-08dd338e0c14", FixedIPs: []servers.FixedIP{ { SubnetID: "dc84c9dc-0b4d-40fc-8605-e518af7cdd30", IPAddress: "192.168.4.3", }, }, }, }, }, { ID: "8bea93c4-721b-480c-8713-f2a4b6e5dbad", MACAddr: "8C:DC:D4:B7:41:49", Plane: "STORAGE", NetworkPhysicalPortID: "ab38075d-128f-4f3d-a16a-c6426375a380", HardwareID: "8e1e2fe0-60a7-4211-a891-80e808426708", AttachedPorts: []servers.Port{}, }, { ID: "a7fbca5e-ff49-4ddb-8659-02ec462f98ec", MACAddr: "8C:DC:D4:B7:45:89", Plane: "STORAGE", NetworkPhysicalPortID: "9ef62803-7848-460c-9dae-17fd02606a26", HardwareID: "1aa1c2a4-2608-41e6-b4f5-87679d1aea43", AttachedPorts: []servers.Port{}, }, { ID: "71af4de1-0c9b-4870-8c95-c7b9b4115bb8", MACAddr: "8C:DC:D4:B7:45:88", Plane: "DATA", NetworkPhysicalPortID: "ad92f33a-eac4-408d-bc27-22d91eccd465", HardwareID: "1aa1c2a4-2608-41e6-b4f5-87679d1aea43", AttachedPorts: []servers.Port{ { NetworkID: "722f9e4f-39f8-406a-b98c-5fbd5689b89a", PortID: "705bde94-7189-40b1-b8a2-188e6cc3c546", FixedIPs: []servers.FixedIP{ { SubnetID: "dc84c9dc-0b4d-40fc-8605-e518af7cdd30", IPAddress: "192.168.4.4", }, }, }, { NetworkID: "4a59f728-3920-4b71-ae54-d0d5c14ba04b", PortID: "7b860eb4-0eb6-4c2a-873e-ccefd6029d97", FixedIPs: []servers.FixedIP{ { SubnetID: "b87d9c85-af5c-403d-a49a-55a6ab0a36d2", IPAddress: "169.254.0.12", }, }, }, }, }, }, ChassisStatus: servers.ChassisStatus{ ChassisPower: true, PowerSupply: true, CPU: true, Memory: true, Fan: true, Disk: 0, Nic: true, SystemBoard: true, Etc: true, Console: true, }, Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/v2/1bc271e7a8af4d988ff91612f5b122f8/servers/621b56e4-4aae-4de5-86a0-8ffeeda6a00b", Rel: "self", }, { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/servers/621b56e4-4aae-4de5-86a0-8ffeeda6a00b", Rel: "bookmark", }, }, RaidArrays: []servers.RaidArray{ { PrimaryStorage: true, Partitions: nil, RaidCardHardwareID: "24184dcf-dc76-4ea2-a34e-bccc6c11d5be", DiskHardwareIDs: []string{ "4de7d3df-8e2f-4193-98dc-145f78df29a2", "de158fab-7bc2-49e3-98d1-9db5451d43e3", "97087307-cab2-40cb-a84c-86d98da0f393", }, }, }, LvmVolumeGroups: nil, Filesystems: nil, MediaAttachments: []servers.MediaAttachment{}, ManagedByService: "dedicated-hypervisor", ManagedServiceResourceID: "194573e4-8f53-4ee4-806f-d9b2db74a380", }, }
FirstServerDetail is the first resource in the List details request.
var SecondServer = servers.Server{ ID: "f42dbc37-4642-4628-8b47-50bf95d8fdd5", Name: "test", Links: []servers.Link{ { Href: "https://dedicated-hypervisor-jp1-ecl.api.ntt.com/v1.0//v2/1bc271e7a8af4d988ff91612f5b122f8/servers/f42dbc37-4642-4628-8b47-50bf95d8fdd5", Rel: "self", }, { Href: "https://dedicated-hypervisor-jp1-ecl.api.ntt.com/v1.0//1bc271e7a8af4d988ff91612f5b122f8/servers/f42dbc37-4642-4628-8b47-50bf95d8fdd5", Rel: "bookmark", }, }, BaremetalServer: servers.BaremetalServer{ ID: "24ebe7b8-ecfb-4d9f-a66b-c0120534fc90", Name: "test", Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/v2/1bc271e7a8af4d988ff91612f5b122f8/servers/24ebe7b8-ecfb-4d9f-a66b-c0120534fc90", Rel: "self", }, { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/servers/24ebe7b8-ecfb-4d9f-a66b-c0120534fc90", Rel: "bookmark", }, }, }, }
SecondServer is the second resource in the List request.
var SecondServerDescription = "test"
var SecondServerDetail = servers.Server{ ID: "f42dbc37-4642-4628-8b47-50bf95d8fdd5", Name: "test", ImageRef: "dfd25820-b368-4012-997b-29a6d0cf8518", Description: &SecondServerDescription, Status: "ACTIVE", HypervisorType: "vsphere_esxi", BaremetalServer: servers.BaremetalServer{ PowerState: "RUNNING", TaskState: "None", VMState: "ACTIVE", AvailabilityZone: "groupb", Created: time.Date(2019, 10, 10, 4, 11, 41, 0, time.UTC), Flavor: servers.Flavor{ ID: "a830b61c-3155-4a61-b7ed-c450862845e6", Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/flavors/a830b61c-3155-4a61-b7ed-c450862845e6", Rel: "bookmark", }, }, }, ID: "24ebe7b8-ecfb-4d9f-a66b-c0120534fc90", Image: servers.Image{ ID: "112a26a0-ff25-4513-afe1-407e41b0a48b", Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/images/112a26a0-ff25-4513-afe1-407e41b0a48b", Rel: "bookmark", }, }, }, Metadata: map[string]string{}, Name: "test", Progress: 100, Status: "ACTIVE", TenantID: "1bc271e7a8af4d988ff91612f5b122f8", Updated: time.Date(2019, 10, 10, 4, 14, 8, 0, time.UTC), UserID: "55891ce6a3cb4bb0833514667d67288c", NicPhysicalPorts: []servers.NicPhysicalPort{ { ID: "a2f63380-6c77-4cd5-8868-e3556ffd35ce", MACAddr: "48:DF:37:90:B4:58", Plane: "DATA", NetworkPhysicalPortID: "d8e40a51-f1e2-4681-8953-9fe1e9992c42", HardwareID: "be2d30d6-f891-4200-b827-95f229fb8c6b", AttachedPorts: []servers.Port{ { NetworkID: "94055904-6b2c-4839-a14a-c61c93a8bc48", PortID: "30fc1c27-fb5f-4955-94d0-a56cd28d09e8", FixedIPs: []servers.FixedIP{ { SubnetID: "acd41997-5ebb-4ff2-8cd2-22cae6cf2883", IPAddress: "2.1.1.10", }, }, }, { NetworkID: "4a59f728-3920-4b71-ae54-d0d5c14ba04b", PortID: "aa6c61f4-db8a-44c7-a91c-7e636dac1dc6", FixedIPs: []servers.FixedIP{ { SubnetID: "b87d9c85-af5c-403d-a49a-55a6ab0a36d2", IPAddress: "169.254.0.9", }, }, }, }, }, { ID: "b01dfdb0-f247-47d8-8224-c257aa3265e9", MACAddr: "48:DF:37:90:B4:50", Plane: "STORAGE", NetworkPhysicalPortID: "00dfea92-5c5b-4860-aa05-efef6c2bb2af", HardwareID: "be2d30d6-f891-4200-b827-95f229fb8c6b", AttachedPorts: []servers.Port{}, }, { ID: "f4355e8e-39fc-48bd-a283-a2dbef8a2e32", MACAddr: "48:DF:37:82:B0:A0", Plane: "STORAGE", NetworkPhysicalPortID: "cf798cc0-c869-45d5-a5a7-bcc578a300b0", HardwareID: "84c74a86-7045-4284-80f9-0e7aff5d27ad", AttachedPorts: []servers.Port{}, }, { ID: "5ef177fd-888c-4fae-9925-a8920beb07cb", MACAddr: "48:DF:37:82:B0:A8", Plane: "DATA", NetworkPhysicalPortID: "2bbbb516-c75a-42b2-8a46-9cb5f26c219e", HardwareID: "84c74a86-7045-4284-80f9-0e7aff5d27ad", AttachedPorts: []servers.Port{ { NetworkID: "94055904-6b2c-4839-a14a-c61c93a8bc48", PortID: "4e329a01-2cf4-4028-9259-03b7aa145cb6", FixedIPs: []servers.FixedIP{ { SubnetID: "acd41997-5ebb-4ff2-8cd2-22cae6cf2883", IPAddress: "2.1.1.20", }, }, }, { NetworkID: "4a59f728-3920-4b71-ae54-d0d5c14ba04b", PortID: "a256b4a1-3ae3-4102-a14e-987ae1610f97", FixedIPs: []servers.FixedIP{ { SubnetID: "b87d9c85-af5c-403d-a49a-55a6ab0a36d2", IPAddress: "169.254.0.10", }, }, }, }, }, }, ChassisStatus: servers.ChassisStatus{ ChassisPower: true, PowerSupply: true, CPU: true, Memory: true, Fan: true, Disk: 0, Nic: true, SystemBoard: true, Etc: true, Console: true, }, Links: []servers.Link{ { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/v2/1bc271e7a8af4d988ff91612f5b122f8/servers/24ebe7b8-ecfb-4d9f-a66b-c0120534fc90", Rel: "self", }, { Href: "https://baremetal-server-jp1-ecl.api.ntt.com/1bc271e7a8af4d988ff91612f5b122f8/servers/24ebe7b8-ecfb-4d9f-a66b-c0120534fc90", Rel: "bookmark", }, }, RaidArrays: []servers.RaidArray{ { PrimaryStorage: true, Partitions: nil, RaidCardHardwareID: "bdfb75d1-194d-426d-b288-f588dfa5ac49", DiskHardwareIDs: []string{ "76649053-863e-4533-86e3-f194a79485a6", "a25827e3-67da-47be-ba96-849ab4685a1d", }, }, }, LvmVolumeGroups: nil, Filesystems: nil, MediaAttachments: []servers.MediaAttachment{}, ManagedByService: "dedicated-hypervisor", ManagedServiceResourceID: "f42dbc37-4642-4628-8b47-50bf95d8fdd5", }, }
SecondServerDetail is the second resource in the List detail request.
Functions ¶
func HandleCreateServerSuccessfully ¶
HandleCreateServerSuccessfully creates an HTTP handler at `/servers` on the test handler mux that tests server creation.
func HandleDeleteServerSuccessfully ¶
HandleDeleteServerSuccessfully creates an HTTP handler at `/servers` on the test handler mux that tests server deletion.
func HandleGetServerSuccessfully ¶
HandleGetServerSuccessfully creates an HTTP handler at `/servers` on the test handler mux that responds with a single server.
func HandleListServersDetailsSuccessfully ¶
HandleListServersDetailsSuccessfully creates an HTTP handler at `/servers/detail` on the test handler mux that responds with a list of two servers.
func HandleListServersSuccessfully ¶
HandleListServersSuccessfully creates an HTTP handler at `/servers` on the test handler mux that responds with a list of two servers.
Types ¶
This section is empty.