summaryrefslogtreecommitdiff
path: root/lib/google_api/cloud_platform/client.rb
blob: f2305eab3b7b8f62e11cee9ebbf8d8fb656deed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module GoogleApi
  module CloudPlatform
    class Client < GoogleApi::Authentication
      # Google::Apis::ContainerV1::ContainerService.new

      class << self
        def token_in_session
          :cloud_platform_access_token
        end
      end

      def scope
        'https://www.googleapis.com/auth/cloud-platform'
      end

      def projects_zones_clusters_get
        # TODO: 
        # service = Google::Apis::ContainerV1::ContainerService.new
        # service.authorization = access_token
        # project_id = params['project_id']
        # ...
        # response = service.list_zone_clusters(project_id, zone)
        response
      end

      def projects_zones_clusters_create(gcp_project_id, cluster_zone, cluster_name, cluster_size)
        # TODO: Google::Apis::ContainerV1::ContainerService.new

        # TODO: Debug
        {
          'end_point' => '111.111.111.111',
          'ca_cert' => 'XXXXXXXXXXXXXXXXXX',
          'username' => 'AAA',
          'password' => 'BBB'
        }
      end
    end
  end
end