github.com/openshift-online/ocm-sdk-go@v0.1.473/clustersmgmt/v1/metric_queries_client.go (about) 1 /* 2 Copyright (c) 2020 Red Hat, Inc. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all 18 // your changes will be lost when the file is generated again. 19 20 package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1 21 22 import ( 23 "net/http" 24 "path" 25 ) 26 27 // MetricQueriesClient is the client of the 'metric_queries' resource. 28 // 29 // Manages telemetry queries for a cluster. 30 type MetricQueriesClient struct { 31 transport http.RoundTripper 32 path string 33 } 34 35 // NewMetricQueriesClient creates a new client for the 'metric_queries' 36 // resource using the given transport to send the requests and receive the 37 // responses. 38 func NewMetricQueriesClient(transport http.RoundTripper, path string) *MetricQueriesClient { 39 return &MetricQueriesClient{ 40 transport: transport, 41 path: path, 42 } 43 } 44 45 // CPUTotalByNodeRolesOS returns the target 'CPU_total_by_node_roles_OS_metric_query' resource. 46 // 47 // Reference to the resource that retrieves the total cpu 48 // capacity in the cluster by node role and operating system. 49 func (c *MetricQueriesClient) CPUTotalByNodeRolesOS() *CPUTotalByNodeRolesOSMetricQueryClient { 50 return NewCPUTotalByNodeRolesOSMetricQueryClient( 51 c.transport, 52 path.Join(c.path, "cpu_total_by_node_roles_os"), 53 ) 54 } 55 56 // Alerts returns the target 'alerts_metric_query' resource. 57 // 58 // Reference to the resource that retrieves the firing alerts in the cluster. 59 func (c *MetricQueriesClient) Alerts() *AlertsMetricQueryClient { 60 return NewAlertsMetricQueryClient( 61 c.transport, 62 path.Join(c.path, "alerts"), 63 ) 64 } 65 66 // ClusterOperators returns the target 'cluster_operators_metric_query' resource. 67 // 68 // Reference to the resource that retrieves the cluster operator status metrics. 69 func (c *MetricQueriesClient) ClusterOperators() *ClusterOperatorsMetricQueryClient { 70 return NewClusterOperatorsMetricQueryClient( 71 c.transport, 72 path.Join(c.path, "cluster_operators"), 73 ) 74 } 75 76 // Nodes returns the target 'nodes_metric_query' resource. 77 // 78 // Reference to the resource that retrieves the nodes in the cluster. 79 func (c *MetricQueriesClient) Nodes() *NodesMetricQueryClient { 80 return NewNodesMetricQueryClient( 81 c.transport, 82 path.Join(c.path, "nodes"), 83 ) 84 } 85 86 // SocketTotalByNodeRolesOS returns the target 'socket_total_by_node_roles_OS_metric_query' resource. 87 // 88 // Reference to the resource that retrieves the total socket 89 // capacity in the cluster by node role and operating system. 90 func (c *MetricQueriesClient) SocketTotalByNodeRolesOS() *SocketTotalByNodeRolesOSMetricQueryClient { 91 return NewSocketTotalByNodeRolesOSMetricQueryClient( 92 c.transport, 93 path.Join(c.path, "socket_total_by_node_roles_os"), 94 ) 95 }