Commit 957bedb1 authored by Matija Čupić's avatar Matija Čupić

Add Google Cloud client project billing info

parent 596ea9e3
require 'google/apis/container_v1' require 'google/apis/container_v1'
require 'google/apis/cloudbilling_v1'
require 'google/apis/cloudresourcemanager_v1' require 'google/apis/cloudresourcemanager_v1'
module GoogleApi module GoogleApi
...@@ -50,6 +51,13 @@ module GoogleApi ...@@ -50,6 +51,13 @@ module GoogleApi
end end
end end
def projects_get_billing_info(project_name)
service = Google::Apis::CloudbillingV1::CloudbillingService.new
service.authorization = access_token
service.get_project_billing_info(project_name)
end
def projects_zones_clusters_get(project_id, zone, cluster_id) def projects_zones_clusters_get(project_id, zone, cluster_id)
service = Google::Apis::ContainerV1::ContainerService.new service = Google::Apis::ContainerV1::ContainerService.new
service.authorization = access_token service.authorization = access_token
......
...@@ -62,6 +62,18 @@ describe GoogleApi::CloudPlatform::Client do ...@@ -62,6 +62,18 @@ describe GoogleApi::CloudPlatform::Client do
it { is_expected.to eq(projects) } it { is_expected.to eq(projects) }
end end
def projects_get_billing_info
subject { client.projects_get_billing_info }
let(:billing_info) { double }
before do
allow_any_instance_of(Google::Apis::CloudbillingV1::CloudbillingService)
.to receive(:get_project_billing_info).and_return(billing_info)
end
it { is_expected.to eq(billing_info) }
end
describe '#projects_zones_clusters_get' do describe '#projects_zones_clusters_get' do
subject { client.projects_zones_clusters_get(spy, spy, spy) } subject { client.projects_zones_clusters_get(spy, spy, spy) }
let(:gke_cluster) { double } let(:gke_cluster) { double }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment