Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f7db2eef
Commit
f7db2eef
authored
Oct 22, 2015
by
Prashanth Balasubramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloudprovider methods to list resources and get health
parent
e42f5af6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
gce.go
pkg/cloudprovider/providers/gce/gce.go
+38
-0
No files found.
pkg/cloudprovider/providers/gce/gce.go
View file @
f7db2eef
...
...
@@ -956,6 +956,11 @@ func (gce *GCECloud) DeleteUrlMap(name string) error {
return
gce
.
waitForGlobalOp
(
op
)
}
// ListUrlMaps lists all UrlMaps in the project.
func
(
gce
*
GCECloud
)
ListUrlMaps
()
(
*
compute
.
UrlMapList
,
error
)
{
return
gce
.
service
.
UrlMaps
.
List
(
gce
.
projectID
)
.
Do
()
}
// TargetHttpProxy management
// GetTargetHttpProxy returns the UrlMap by name.
...
...
@@ -1000,6 +1005,11 @@ func (gce *GCECloud) DeleteTargetHttpProxy(name string) error {
return
gce
.
waitForGlobalOp
(
op
)
}
// ListTargetHttpProxies lists all TargetHttpProxies in the project.
func
(
gce
*
GCECloud
)
ListTargetHttpProxies
()
(
*
compute
.
TargetHttpProxyList
,
error
)
{
return
gce
.
service
.
TargetHttpProxies
.
List
(
gce
.
projectID
)
.
Do
()
}
// GlobalForwardingRule management
// CreateGlobalForwardingRule creates and returns a GlobalForwardingRule that points to the given TargetHttpProxy.
...
...
@@ -1046,6 +1056,11 @@ func (gce *GCECloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRu
return
gce
.
service
.
GlobalForwardingRules
.
Get
(
gce
.
projectID
,
name
)
.
Do
()
}
// ListGlobalForwardingRules lists all GlobalForwardingRules in the project.
func
(
gce
*
GCECloud
)
ListGlobalForwardingRules
()
(
*
compute
.
ForwardingRuleList
,
error
)
{
return
gce
.
service
.
GlobalForwardingRules
.
List
(
gce
.
projectID
)
.
Do
()
}
// BackendService Management
// GetBackendService retrieves a backend by name.
...
...
@@ -1083,6 +1098,19 @@ func (gce *GCECloud) CreateBackendService(bg *compute.BackendService) error {
return
gce
.
waitForGlobalOp
(
op
)
}
// ListBackendServices lists all backend services in the project.
func
(
gce
*
GCECloud
)
ListBackendServices
()
(
*
compute
.
BackendServiceList
,
error
)
{
return
gce
.
service
.
BackendServices
.
List
(
gce
.
projectID
)
.
Do
()
}
// GetHealth returns the health of the BackendService identified by the given
// name, in the given instanceGroup. The instanceGroupLink is the fully
// qualified self link of an instance group.
func
(
gce
*
GCECloud
)
GetHealth
(
name
string
,
instanceGroupLink
string
)
(
*
compute
.
BackendServiceGroupHealth
,
error
)
{
groupRef
:=
&
compute
.
ResourceGroupReference
{
instanceGroupLink
}
return
gce
.
service
.
BackendServices
.
GetHealth
(
gce
.
projectID
,
name
,
groupRef
)
.
Do
()
}
// Health Checks
// GetHttpHealthCheck returns the given HttpHealthCheck by name.
...
...
@@ -1120,6 +1148,11 @@ func (gce *GCECloud) CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error {
return
gce
.
waitForGlobalOp
(
op
)
}
// ListHttpHealthCheck lists all HttpHealthChecks in the project.
func
(
gce
*
GCECloud
)
ListHttpHealthChecks
()
(
*
compute
.
HttpHealthCheckList
,
error
)
{
return
gce
.
service
.
HttpHealthChecks
.
List
(
gce
.
projectID
)
.
Do
()
}
// InstanceGroup Management
// CreateInstanceGroup creates an instance group with the given instances. It is the callers responsibility to add named ports.
...
...
@@ -1145,6 +1178,11 @@ func (gce *GCECloud) DeleteInstanceGroup(name string) error {
return
gce
.
waitForZoneOp
(
op
)
}
// ListInstanceGroups lists all InstanceGroups in the project and zone.
func
(
gce
*
GCECloud
)
ListInstanceGroups
()
(
*
compute
.
InstanceGroupList
,
error
)
{
return
gce
.
service
.
InstanceGroups
.
List
(
gce
.
projectID
,
gce
.
zone
)
.
Do
()
}
// ListInstancesInInstanceGroup lists all the instances in a given istance group and state.
func
(
gce
*
GCECloud
)
ListInstancesInInstanceGroup
(
name
string
,
state
string
)
(
*
compute
.
InstanceGroupsListInstances
,
error
)
{
return
gce
.
service
.
InstanceGroups
.
ListInstances
(
...
...
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