Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
957bedb1
Commit
957bedb1
authored
Dec 15, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Google Cloud client project billing info
parent
596ea9e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
lib/google_api/cloud_platform/client.rb
lib/google_api/cloud_platform/client.rb
+8
-0
spec/lib/google_api/cloud_platform/client_spec.rb
spec/lib/google_api/cloud_platform/client_spec.rb
+12
-0
No files found.
lib/google_api/cloud_platform/client.rb
View file @
957bedb1
require
'google/apis/container_v1'
require
'google/apis/cloudbilling_v1'
require
'google/apis/cloudresourcemanager_v1'
module
GoogleApi
...
...
@@ -50,6 +51,13 @@ module GoogleApi
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
)
service
=
Google
::
Apis
::
ContainerV1
::
ContainerService
.
new
service
.
authorization
=
access_token
...
...
spec/lib/google_api/cloud_platform/client_spec.rb
View file @
957bedb1
...
...
@@ -62,6 +62,18 @@ describe GoogleApi::CloudPlatform::Client do
it
{
is_expected
.
to
eq
(
projects
)
}
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
subject
{
client
.
projects_zones_clusters_get
(
spy
,
spy
,
spy
)
}
let
(
:gke_cluster
)
{
double
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment