Skip to content

Commit f428767

Browse files
committed
add custom metrics APIs (custom.metrics.k8s.io)
Add APIs for `custom.metrics.k8s.io/v1beta1`. Kubernetes OpenAPI specs do not include custom metrics endpoints. This PR update the specifications first for that, and then uses it to generate the required code. Both the updated specifications and generated code is included in this PR. These changes need to be merged when we upgrade to a newer specification in future. Since the custom metrics APIs take more than one parameters, unlike the rest of the Kubernetes APIs, we can no longer generalize both `list` and `get` forms into the same `get` API. This PR therefore exposes a new `list` API from Kuber.jl that explicitly does listing. The new `list` API works for both custom metrics and any other Kubernetes resource that supports listing. The older `get` API continues to work for listing resources other than custom metrics. We also needed to genralize the custom metrics API to match the rest of Kubernetes format. That meant taking a composite metric name as a single string, separated by `/` character. It matches the way Kubernetes API discovery exposes the endpoints too. The downside however is that it needs the API user to be cognizant of the formatting rule. Therefore we also exported some helper methods - `list_custom_metrics` and `list_namespaced_custom_metrics`, which are detailed below. Here are some outputs that help illustrate the API calls: ```julia julia> # same as: list(ctx, :MetricValue, "metrics/coredns_forward_request_duration_seconds_sum") julia> list_namespaced_custom_metrics(ctx, "coredns_forward_request_duration_seconds_sum") { "kind": "MetricValueList", "metadata": { "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/metrics/coredns_forward_request_duration_seconds_sum" }, "apiVersion": "custom.metrics.k8s.io/v1beta1", "items": [ { "timestamp": "2020-03-13T06:40:17Z", "value": "23336m", "metricName": "coredns_forward_request_duration_seconds_sum", "describedObject": { "kind": "Namespace", "apiVersion": "/v1", "name": "kube-system" } } ] } julia> # same as: list(ctx, :MetricValue, "pods/*/coredns_forward_request_duration_seconds_sum") julia> list_namespaced_custom_metrics(ctx, "pods", "coredns_forward_request_duration_seconds_sum") { "kind": "MetricValueList", "metadata": { "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/%2A/coredns_forward_request_duration_seconds_sum" }, "apiVersion": "custom.metrics.k8s.io/v1beta1", "items": [ { "timestamp": "2020-03-13T06:45:39Z", "value": "11452m", "metricName": "coredns_forward_request_duration_seconds_sum", "describedObject": { "kind": "Pod", "apiVersion": "/v1", "name": "coredns-6955765f44-66hlh", "namespace": "kube-system" } }, { "timestamp": "2020-03-13T06:45:39Z", "value": "12338m", "metricName": "coredns_forward_request_duration_seconds_sum", "describedObject": { "kind": "Pod", "apiVersion": "/v1", "name": "coredns-6955765f44-n4nhj", "namespace": "kube-system" } } ] } julia> # same as: list(ctx, :MetricValue, "pods/coredns-6955765f44-n4nhj/coredns_forward_request_duration_seconds_sum") julia> list_namespaced_custom_metrics(ctx, "pods", "coredns-6955765f44-n4nhj", "coredns_forward_request_duration_seconds_sum") { "kind": "MetricValueList", "metadata": { "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/kube-system/pods/coredns-6955765f44-n4nhj/coredns_forward_request_duration_seconds_sum" }, "apiVersion": "custom.metrics.k8s.io/v1beta1", "items": [ { "timestamp": "2020-03-13T06:47:01Z", "value": "12338m", "metricName": "coredns_forward_request_duration_seconds_sum", "describedObject": { "kind": "Pod", "apiVersion": "/v1", "name": "coredns-6955765f44-n4nhj", "namespace": "kube-system" } } ] } julia> # same as: list(ctx, :MetricValue, "nodes/*/go_memstats_last_gc_time_seconds"; namespace=nothing) julia> list_custom_metrics(ctx, "nodes", "go_memstats_last_gc_time_seconds") { "kind": "MetricValueList", "metadata": { "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/nodes/%2A/go_memstats_last_gc_time_seconds" }, "apiVersion": "custom.metrics.k8s.io/v1beta1", "items": [ { "timestamp": "2020-03-13T06:49:27Z", "value": "1584082154494m", "metricName": "go_memstats_last_gc_time_seconds", "describedObject": { "kind": "Node", "apiVersion": "/v1", "name": "tanlto" } } ] } julia> # same as: list(ctx, :MetricValue, "nodes/tanlto/go_memstats_last_gc_time_seconds"; namespace=nothing) julia> list_custom_metrics(ctx, "nodes", "tanlto", "go_memstats_last_gc_time_seconds") { "kind": "MetricValueList", "metadata": { "selfLink": "/apis/custom.metrics.k8s.io/v1beta1/nodes/tanlto/go_memstats_last_gc_time_seconds" }, "apiVersion": "custom.metrics.k8s.io/v1beta1", "items": [ { "timestamp": "2020-03-13T06:50:13Z", "value": "1584082185722m", "metricName": "go_memstats_last_gc_time_seconds", "describedObject": { "kind": "Node", "apiVersion": "/v1", "name": "tanlto" } } ] } ```
1 parent 2455134 commit f428767

10 files changed

+426
-3
lines changed

gen/spec/swagger.json

Lines changed: 224 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20917,6 +20917,64 @@
2091720917
"description": "List of pod metrics."
2091820918
}
2091920919
}
20920+
},
20921+
"io.k8s.api.custom.metrics.v1beta1.MetricValue": {
20922+
"description": "a metric value for some object",
20923+
"properties": {
20924+
"apiVersion": {
20925+
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
20926+
"type": "string"
20927+
},
20928+
"kind": {
20929+
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
20930+
"type": "string"
20931+
},
20932+
"describedObject": {
20933+
"$ref": "#/definitions/io.k8s.api.core.v1.ObjectReference",
20934+
"description": "a reference to the described object"
20935+
},
20936+
"metricName": {
20937+
"description": "the name of the metric",
20938+
"type": "string"
20939+
},
20940+
"timestamp": {
20941+
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time",
20942+
"description": "indicates the time at which the metrics were produced"
20943+
},
20944+
"windowSeconds": {
20945+
"description": "indicates the window ([Timestamp-Window, Timestamp]) from which these metrics were calculated, when returning rate metrics calculated from cumulative metrics (or zero for non-calculated instantaneous metrics).",
20946+
"format": "int64",
20947+
"type": "integer"
20948+
},
20949+
"value": {
20950+
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity",
20951+
"description": "the value of the metric for this"
20952+
}
20953+
}
20954+
},
20955+
"io.k8s.api.custom.metrics.v1beta1.MetricValueList": {
20956+
"description": "a list of values for a given metric for some set of objects",
20957+
"properties": {
20958+
"apiVersion": {
20959+
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
20960+
"type": "string"
20961+
},
20962+
"kind": {
20963+
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
20964+
"type": "string"
20965+
},
20966+
"metadata": {
20967+
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta",
20968+
"description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
20969+
},
20970+
"items": {
20971+
"items": {
20972+
"$ref": "#/definitions/io.k8s.api.custom.metrics.v1beta1.MetricValue"
20973+
},
20974+
"type": "array",
20975+
"description": "the value of the metric across the described objects"
20976+
}
20977+
}
2092020978
}
2092120979
},
2092220980
"info": {
@@ -117449,7 +117507,6 @@
117449117507
"type": "boolean",
117450117508
"uniqueItems": true
117451117509
}
117452-
117453117510
],
117454117511
"produces": [
117455117512
"application/json",
@@ -117632,6 +117689,172 @@
117632117689
"uniqueItems": true
117633117690
}
117634117691
]
117692+
},
117693+
"/apis/custom.metrics.k8s.io/v1beta1/{compositemetricname}": {
117694+
"get": {
117695+
"consumes": [
117696+
"*/*"
117697+
],
117698+
"description": "Retrieve the given metric for the given non-namespaced object (e.g. Node, PersistentVolume). Composite metric name is of the form \"<objecttype>/<objectname>/<metricname>\" Passing '*' for objectname would retrieve the given metric for all non-namespaced objects of the given type.",
117699+
"operationId": "listCustomMetricsV1beta1MetricValue",
117700+
"parameters": [
117701+
{
117702+
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
117703+
"in": "query",
117704+
"name": "fieldSelector",
117705+
"type": "string",
117706+
"uniqueItems": true
117707+
},
117708+
{
117709+
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
117710+
"in": "query",
117711+
"name": "labelSelector",
117712+
"type": "string",
117713+
"uniqueItems": true
117714+
},
117715+
{
117716+
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
117717+
"in": "query",
117718+
"name": "limit",
117719+
"type": "integer",
117720+
"uniqueItems": true
117721+
}
117722+
],
117723+
"produces": [
117724+
"application/json",
117725+
"application/yaml",
117726+
"application/vnd.kubernetes.protobuf",
117727+
"application/json;stream=watch",
117728+
"application/vnd.kubernetes.protobuf;stream=watch"
117729+
],
117730+
"responses": {
117731+
"200": {
117732+
"description": "OK",
117733+
"schema": {
117734+
"$ref": "#/definitions/io.k8s.api.custom.metrics.v1beta1.MetricValueList"
117735+
}
117736+
},
117737+
"401": {
117738+
"description": "Unauthorized"
117739+
}
117740+
},
117741+
"schemes": [
117742+
"https"
117743+
],
117744+
"tags": [
117745+
"custom_metrics_v1beta1"
117746+
],
117747+
"x-kubernetes-action": "list",
117748+
"x-kubernetes-group-version-kind": {
117749+
"group": "",
117750+
"kind": "MetricValueList",
117751+
"version": "v1beta1"
117752+
}
117753+
},
117754+
"parameters": [
117755+
{
117756+
"description": "composite metric name",
117757+
"in": "path",
117758+
"name": "compositemetricname",
117759+
"required": true,
117760+
"type": "string",
117761+
"uniqueItems": true
117762+
},
117763+
{
117764+
"description": "If 'true', then the output is pretty printed.",
117765+
"in": "query",
117766+
"name": "pretty",
117767+
"type": "string",
117768+
"uniqueItems": true
117769+
}
117770+
]
117771+
},
117772+
"/apis/custom.metrics.k8s.io/v1beta1/namespaces/{namespace}/{compositemetricname}": {
117773+
"get": {
117774+
"consumes": [
117775+
"*/*"
117776+
],
117777+
"description": "retrieve the given metric (in composite form) which describes the given namespace. Composite form of metrics can be either \"metric/<metricname>\" to fetch metrics of all objects in the namespace, or \"<objecttype>/<objectname>/<metricname>\" to fetch metrics of the specified object type and name. Passing \"*\" for objectname would fetch metrics of all objects of the specified type in the namespace.",
117778+
"operationId": "listCustomMetricsV1beta1NamespacedMetricValue",
117779+
"parameters": [
117780+
{
117781+
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
117782+
"in": "query",
117783+
"name": "fieldSelector",
117784+
"type": "string",
117785+
"uniqueItems": true
117786+
},
117787+
{
117788+
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
117789+
"in": "query",
117790+
"name": "labelSelector",
117791+
"type": "string",
117792+
"uniqueItems": true
117793+
},
117794+
{
117795+
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
117796+
"in": "query",
117797+
"name": "limit",
117798+
"type": "integer",
117799+
"uniqueItems": true
117800+
}
117801+
],
117802+
"produces": [
117803+
"application/json",
117804+
"application/yaml",
117805+
"application/vnd.kubernetes.protobuf",
117806+
"application/json;stream=watch",
117807+
"application/vnd.kubernetes.protobuf;stream=watch"
117808+
],
117809+
"responses": {
117810+
"200": {
117811+
"description": "OK",
117812+
"schema": {
117813+
"$ref": "#/definitions/io.k8s.api.custom.metrics.v1beta1.MetricValueList"
117814+
}
117815+
},
117816+
"401": {
117817+
"description": "Unauthorized"
117818+
}
117819+
},
117820+
"schemes": [
117821+
"https"
117822+
],
117823+
"tags": [
117824+
"custom_metrics_v1beta1"
117825+
],
117826+
"x-kubernetes-action": "list",
117827+
"x-kubernetes-group-version-kind": {
117828+
"group": "",
117829+
"kind": "MetricValueList",
117830+
"version": "v1beta1"
117831+
}
117832+
},
117833+
"parameters": [
117834+
{
117835+
"description": "composite metric name",
117836+
"in": "path",
117837+
"name": "compositemetricname",
117838+
"required": true,
117839+
"type": "string",
117840+
"uniqueItems": true
117841+
},
117842+
{
117843+
"description": "name of the namespace",
117844+
"in": "path",
117845+
"name": "namespace",
117846+
"required": true,
117847+
"type": "string",
117848+
"uniqueItems": true
117849+
},
117850+
{
117851+
"description": "If 'true', then the output is pretty printed.",
117852+
"in": "query",
117853+
"name": "pretty",
117854+
"type": "string",
117855+
"uniqueItems": true
117856+
}
117857+
]
117635117858
}
117636117859
},
117637117860
"security": [

src/Kuber.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ include("helpers.jl")
1717
include("simpleapi.jl")
1818

1919
export KuberContext, set_server, set_ns, get_server, get_ns, kuber_type, kuber_obj, @K_str
20-
export get, put!, update!, delete!, sel, get_logs
20+
export get, list, put!, update!, delete!, sel, get_logs, list_namespaced_custom_metrics, list_custom_metrics
2121

2222
end # module

src/api/Kubernetes.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ include("api_CoordinationV1Api.jl")
4949
include("api_CoordinationV1beta1Api.jl")
5050
include("api_CoreApi.jl")
5151
include("api_CoreV1Api.jl")
52+
include("api_CustomMetricsV1beta1Api.jl")
5253
include("api_DiscoveryApi.jl")
5354
include("api_DiscoveryV1beta1Api.jl")
5455
include("api_EventsApi.jl")
@@ -481,6 +482,8 @@ export convert, IoK8sApiCoreV1VolumeProjection
481482
export convert, IoK8sApiCoreV1VsphereVirtualDiskVolumeSource
482483
export convert, IoK8sApiCoreV1WeightedPodAffinityTerm
483484
export convert, IoK8sApiCoreV1WindowsSecurityContextOptions
485+
export convert, IoK8sApiCustomMetricsV1beta1MetricValue
486+
export convert, IoK8sApiCustomMetricsV1beta1MetricValueList
484487
export convert, IoK8sApiDiscoveryV1beta1Endpoint
485488
export convert, IoK8sApiDiscoveryV1beta1EndpointConditions
486489
export convert, IoK8sApiDiscoveryV1beta1EndpointPort
@@ -781,7 +784,7 @@ export convert, IoK8sKubeAggregatorPkgApisApiregistrationV1beta1APIServiceStatus
781784
export convert, IoK8sKubeAggregatorPkgApisApiregistrationV1beta1ServiceReference
782785

783786
# export operations
784-
export convert, AdmissionregistrationApi, AdmissionregistrationV1Api, AdmissionregistrationV1beta1Api, ApiextensionsApi, ApiextensionsV1Api, ApiextensionsV1beta1Api, ApiregistrationApi, ApiregistrationV1Api, ApiregistrationV1beta1Api, ApisApi, AppsApi, AppsV1Api, AppsV1beta1Api, AppsV1beta2Api, AuditregistrationApi, AuditregistrationV1alpha1Api, AuthenticationApi, AuthenticationV1Api, AuthenticationV1beta1Api, AuthorizationApi, AuthorizationV1Api, AuthorizationV1beta1Api, AutoscalingApi, AutoscalingV1Api, AutoscalingV2beta1Api, AutoscalingV2beta2Api, BatchApi, BatchV1Api, BatchV1beta1Api, BatchV2alpha1Api, CertificatesApi, CertificatesV1beta1Api, CoordinationApi, CoordinationV1Api, CoordinationV1beta1Api, CoreApi, CoreV1Api, DiscoveryApi, DiscoveryV1beta1Api, EventsApi, EventsV1beta1Api, ExtensionsApi, ExtensionsV1beta1Api, FlowcontrolApiserverApi, FlowcontrolApiserverV1alpha1Api, LogsApi, MetricsV1beta1Api, NetworkingApi, NetworkingV1Api, NetworkingV1beta1Api, NodeApi, NodeV1alpha1Api, NodeV1beta1Api, PolicyApi, PolicyV1beta1Api, RbacAuthorizationApi, RbacAuthorizationV1Api, RbacAuthorizationV1alpha1Api, RbacAuthorizationV1beta1Api, SchedulingApi, SchedulingV1Api, SchedulingV1alpha1Api, SchedulingV1beta1Api, SettingsApi, SettingsV1alpha1Api, StorageApi, StorageV1Api, StorageV1alpha1Api, StorageV1beta1Api, VersionApi
787+
export convert, AdmissionregistrationApi, AdmissionregistrationV1Api, AdmissionregistrationV1beta1Api, ApiextensionsApi, ApiextensionsV1Api, ApiextensionsV1beta1Api, ApiregistrationApi, ApiregistrationV1Api, ApiregistrationV1beta1Api, ApisApi, AppsApi, AppsV1Api, AppsV1beta1Api, AppsV1beta2Api, AuditregistrationApi, AuditregistrationV1alpha1Api, AuthenticationApi, AuthenticationV1Api, AuthenticationV1beta1Api, AuthorizationApi, AuthorizationV1Api, AuthorizationV1beta1Api, AutoscalingApi, AutoscalingV1Api, AutoscalingV2beta1Api, AutoscalingV2beta2Api, BatchApi, BatchV1Api, BatchV1beta1Api, BatchV2alpha1Api, CertificatesApi, CertificatesV1beta1Api, CoordinationApi, CoordinationV1Api, CoordinationV1beta1Api, CoreApi, CoreV1Api, CustomMetricsV1beta1Api, DiscoveryApi, DiscoveryV1beta1Api, EventsApi, EventsV1beta1Api, ExtensionsApi, ExtensionsV1beta1Api, FlowcontrolApiserverApi, FlowcontrolApiserverV1alpha1Api, LogsApi, MetricsV1beta1Api, NetworkingApi, NetworkingV1Api, NetworkingV1beta1Api, NodeApi, NodeV1alpha1Api, NodeV1beta1Api, PolicyApi, PolicyV1beta1Api, RbacAuthorizationApi, RbacAuthorizationV1Api, RbacAuthorizationV1alpha1Api, RbacAuthorizationV1beta1Api, SchedulingApi, SchedulingV1Api, SchedulingV1alpha1Api, SchedulingV1beta1Api, SettingsApi, SettingsV1alpha1Api, StorageApi, StorageV1Api, StorageV1alpha1Api, StorageV1beta1Api, VersionApi
785788

786789
export check_required, field_name, property_type, hasproperty, propertynames, validate_property, convert
787790

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This file was generated by the Julia Swagger Code Generator
2+
# Do not modify this file directly. Modify the swagger specification instead.
3+
4+
struct CustomMetricsV1beta1Api <: SwaggerApi
5+
client::Swagger.Client
6+
end
7+
8+
"""
9+
10+
Retrieve the given metric for the given non-namespaced object (e.g. Node, PersistentVolume). Composite metric name is of the form \"<objecttype>/<objectname>/<metricname>\" Passing '*' for objectname would retrieve the given metric for all non-namespaced objects of the given type.
11+
Param: compositemetricname::String (required)
12+
Param: pretty::String
13+
Param: fieldSelector::String
14+
Param: labelSelector::String
15+
Param: limit::Int32
16+
Return: IoK8sApiCustomMetricsV1beta1MetricValueList
17+
"""
18+
function listCustomMetricsV1beta1MetricValue(_api::CustomMetricsV1beta1Api, compositemetricname::String; pretty=nothing, fieldSelector=nothing, labelSelector=nothing, limit=nothing, _mediaType=nothing)
19+
_ctx = Swagger.Ctx(_api.client, "GET", IoK8sApiCustomMetricsV1beta1MetricValueList, "/apis/custom.metrics.k8s.io/v1beta1/{compositemetricname}", ["BearerToken"])
20+
Swagger.set_param(_ctx.path, "compositemetricname", compositemetricname) # type String
21+
Swagger.set_param(_ctx.query, "pretty", pretty) # type String
22+
Swagger.set_param(_ctx.query, "fieldSelector", fieldSelector) # type String
23+
Swagger.set_param(_ctx.query, "labelSelector", labelSelector) # type String
24+
Swagger.set_param(_ctx.query, "limit", limit) # type Int32
25+
Swagger.set_header_accept(_ctx, ["application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch"])
26+
Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["*/*"] : [_mediaType])
27+
Swagger.exec(_ctx)
28+
end
29+
30+
"""
31+
32+
retrieve the given metric (in composite form) which describes the given namespace. Composite form of metrics can be either \"metric/<metricname>\" to fetch metrics of all objects in the namespace, or \"<objecttype>/<objectname>/<metricname>\" to fetch metrics of the specified object type and name. Passing \"*\" for objectname would fetch metrics of all objects of the specified type in the namespace.
33+
Param: compositemetricname::String (required)
34+
Param: namespace::String (required)
35+
Param: pretty::String
36+
Param: fieldSelector::String
37+
Param: labelSelector::String
38+
Param: limit::Int32
39+
Return: IoK8sApiCustomMetricsV1beta1MetricValueList
40+
"""
41+
function listCustomMetricsV1beta1NamespacedMetricValue(_api::CustomMetricsV1beta1Api, compositemetricname::String, namespace::String; pretty=nothing, fieldSelector=nothing, labelSelector=nothing, limit=nothing, _mediaType=nothing)
42+
_ctx = Swagger.Ctx(_api.client, "GET", IoK8sApiCustomMetricsV1beta1MetricValueList, "/apis/custom.metrics.k8s.io/v1beta1/namespaces/{namespace}/{compositemetricname}", ["BearerToken"])
43+
Swagger.set_param(_ctx.path, "compositemetricname", compositemetricname) # type String
44+
Swagger.set_param(_ctx.path, "namespace", namespace) # type String
45+
Swagger.set_param(_ctx.query, "pretty", pretty) # type String
46+
Swagger.set_param(_ctx.query, "fieldSelector", fieldSelector) # type String
47+
Swagger.set_param(_ctx.query, "labelSelector", labelSelector) # type String
48+
Swagger.set_param(_ctx.query, "limit", limit) # type Int32
49+
Swagger.set_header_accept(_ctx, ["application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch"])
50+
Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["*/*"] : [_mediaType])
51+
Swagger.exec(_ctx)
52+
end
53+
54+
export listCustomMetricsV1beta1MetricValue, listCustomMetricsV1beta1NamespacedMetricValue

0 commit comments

Comments
 (0)