func TestGetInstance(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() HandleGet(t) instance, err := instances.Get(fake.ServiceClient(), instanceID).Extract() th.AssertNoErr(t, err) th.AssertDeepEquals(t, &expectedInstance, instance) }
func (c context) WaitUntilActive(id string) { err := gophercloud.WaitFor(60, func() (bool, error) { inst, err := instances.Get(c.client, id).Extract() if err != nil { return false, err } if inst.Status == "ACTIVE" { return true, nil } return false, nil }) c.AssertNoErr(err) }
func (c context) getInstance() { instance, err := instances.Get(c.client, c.instanceID).Extract() c.AssertNoErr(err) c.Logf("Getting instance: %s", instance.ID) }