Sha256: 6a023b4b36e3f3403c04318007d08954a8ed0a1b3b9f5cf96a157109720966f4

Contents?: true

Size: 1.8 KB

Versions: 4

Compression:

Stored size: 1.8 KB

Contents

module Fog
  module ContainerInfra
    class HuaweiCloud
      class Real
        def get_bay(uuid_or_name)
          request(
            :expects => [200],
            :method  => 'GET',
            :path    => "bays/#{uuid_or_name}"
          )
        end
      end

      class Mock
        def get_bay(_uuid_or_name)
          response = Excon::Response.new
          response.status = 200
          response.body = {
            "status"             => "CREATE_COMPLETE",
            "uuid"               => "746e779a-751a-456b-a3e9-c883d734946f",
            "stack_id"           => "9c6f1169-7300-4d08-a444-d2be38758719",
            "created_at"         => "2016-08-29T06:51:31+00:00",
            "api_address"        => "https://172.24.4.6:6443",
            "discovery_url"      => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
            "updated_at"         => "2016-08-29T06:53:24+00:00",
            "master_count"       => 1,
            "coe_version"        => "v1.2.0",
            "baymodel_id"        => "0562d357-8641-4759-8fed-8173f02c9633",
            "master_addresses"   => ["172.24.4.6"],
            "node_count"         => 1,
            "node_addresses"     => ["172.24.4.13"],
            "status_reason"      => "Stack CREATE completed successfully",
            "bay_create_timeout" => 60,
            "name"               => "k8s",
            "links"              => [
              {
                 "href" => "http://10.164.180.104:9511/v1/bays/746e779a-751a-456b-a3e9-c883d734946f",
                 "rel"  => "self"
              },
              {
                 "href" => "http://10.164.180.104:9511/bays/746e779a-751a-456b-a3e9-c883d734946f",
                 "rel"  => "bookmark"
              }
            ]
          }
          response
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/container_infra/huaweicloud/requests/get_bay.rb
fog-huaweicloud-0.0.2 lib/fog/container_infra/huaweicloud/requests/get_bay.rb
fog-huaweicloud-0.1.3 lib/fog/container_infra/huaweicloud/requests/get_bay.rb
fog-huaweicloud-0.1.2 lib/fog/container_infra/huaweicloud/requests/get_bay.rb