1.17. DiscoveredCluster API
1.17.1. 概述
本文档介绍了与 Red Hat Advanced Cluster Management for Kubernetes 的 DiscoveredCluster 资源相关的 API 资源。DiscoveredCluster 资源有 4 个可用的请求:create、query、delete 和 update。
1.17.1.1. 版本信息
版本 : 2.8.0
1.17.1.2. URI scheme
BasePath : /kubernetes/apis
Schemes : HTTPS
1.17.1.3. Tags
- DiscoveredClusters.discovery.open-cluster-management.io : 创建和管理 DiscoveredClusters
1.17.2. 路径
1.17.2.1. 创建一个 DiscoveredCluster
POST /app.k8s.io/v1/namespaces/{namespace}/discoveredclusters
1.17.2.1.1. 描述
创建一个 DiscoveredCluster。
1.17.2.1.2. 参数
类型 | Name | 描述 | 模式 |
---|---|---|---|
标头 |
COOKIE | 身份验证:Bearer {ACCESS_TOKEN} ; ACCESS_TOKEN 是用户访问令牌。 | 字符串 |
路径 |
namespace | 要使用的命名空间,如 default。 | 字符串 |
Body |
body | 描述要创建的 DiscoveredCluster 的参数。 | DiscoveredCluster |
1.17.2.1.3. 响应
HTTP 代码 | 描述 | 模式 |
---|---|---|
200 | 成功 | 无内容 |
403 | 禁止访问 | 无内容 |
404 | 未找到资源 | 无内容 |
500 | 内部服务错误 | 无内容 |
503 | 服务不可用 | 无内容 |
1.17.2.1.4. 使用
-
discoveredclusters/yaml
1.17.2.1.5. Tags
- discoveredclusters.discovery.open-cluster-management.io
1.17.2.1.5.1. 请求正文
{ "apiVersion": "apiextensions.k8s.io/v1", "kind": "CustomResourceDefinition", "metadata": { "annotations": { "controller-gen.kubebuilder.io/version": "v0.4.1",\ }, "creationTimestamp": null, "name": "discoveredclusters.discovery.open-cluster-management.io", }, "spec": { "group": "discovery.open-cluster-management.io", "names": { "kind": "DiscoveredCluster", "listKind": "DiscoveredClusterList", "plural": "discoveredclusters", "singular": "discoveredcluster" }, "scope": "Namespaced", "versions": [ { "name": "v1", "schema": { "openAPIV3Schema": { "description": "DiscoveredCluster is the Schema for the discoveredclusters API", "properties": { "apiVersion": { "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", "type": "string" }, "kind": { "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", "type": "string" }, "metadata": { "type": "object" }, "spec": { "description": "DiscoveredClusterSpec defines the desired state of DiscoveredCluster", "properties": { "activityTimestamp": { "format": "date-time", "type": "string" }, "apiUrl": { "type": "string" }, "cloudProvider": { "type": "string" }, "console": { "type": "string" }, "creationTimestamp": { "format": "date-time", "type": "string" }, "credential": { "description": "ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, \"must refer only to types A and B\" or \"UID not honored\" or \"name must be restricted\". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .", "properties": { "apiVersion": { "description": "API version of the referent.", "type": "string" }, "fieldPath": { "description": "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.", "type": "string" }, "kind": { "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "namespace": { "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", "type": "string" }, "resourceVersion": { "description": "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "uid": { "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", "type": "string" } }, "type": "object" }, "displayName": { "type": "string" }, "isManagedCluster": { "type": "boolean" }, "name": { "type": "string" }, "openshiftVersion": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" } }, "required": [ "apiUrl", "displayName", "isManagedCluster", "name", "type" ], "type": "object" }, "status": { "description": "DiscoveredClusterStatus defines the observed state of DiscoveredCluster", "type": "object" } }, "type": "object" } }, "served": true, "storage": true, "subresources": { "status": {} } } ] }, "status": { "acceptedNames": { "kind": "", "plural": "" }, "conditions": [], "storedVersions": [] } }
1.17.2.2. 查询所有 DiscoveredClusters
GET /operator.open-cluster-management.io/v1/namespaces/{namespace}/operator
1.17.2.2.1. 描述
查询发现的集群 operator 以获取更多详细信息。
1.17.2.2.2. 参数
类型 | Name | 描述 | 模式 |
---|---|---|---|
标头 |
COOKIE | 身份验证:Bearer {ACCESS_TOKEN} ; ACCESS_TOKEN 是用户访问令牌。 | 字符串 |
路径 |
namespace | 要使用的命名空间,如 default。 | 字符串 |
1.17.2.2.3. 响应
HTTP 代码 | 描述 | 模式 |
---|---|---|
200 | 成功 | 无内容 |
403 | 禁止访问 | 无内容 |
404 | 未找到资源 | 无内容 |
500 | 内部服务错误 | 无内容 |
503 | 服务不可用 | 无内容 |
1.17.2.2.4. 使用
-
operator/yaml
1.17.2.2.5. Tags
- discoveredclusters.discovery.open-cluster-management.io
1.17.2.3. 删除 DiscoveredCluster Operator
DELETE /operator.open-cluster-management.io/v1/namespaces/{namespace}/operator/{discoveredclusters_name}
1.17.2.3.1. 参数
类型 | Name | 描述 | 模式 |
---|---|---|---|
标头 |
COOKIE | 身份验证:Bearer {ACCESS_TOKEN} ; ACCESS_TOKEN 是用户访问令牌。 | 字符串 |
路径 |
application_name | 要删除的发现的 Cluster Operator 的名称。 | 字符串 |
路径 |
namespace | 要使用的命名空间,如 default。 | 字符串 |
1.17.2.3.2. 响应
HTTP 代码 | 描述 | 模式 |
---|---|---|
200 | 成功 | 无内容 |
403 | 禁止访问 | 无内容 |
404 | 未找到资源 | 无内容 |
500 | 内部服务错误 | 无内容 |
503 | 服务不可用 | 无内容 |
1.17.2.3.3. Tags
- discoveredclusters.operator.open-cluster-management.io
1.17.3. 定义
1.17.3.1. DiscoveredCluster
Name | 描述 | 模式 |
---|---|---|
apiVersion | 发现集群的版本化 schema。 | 字符串 |
kind | 代表 REST 资源的字符串值。 | 字符串 |
metadata | 描述定义资源的规则。 | 对象 |
spec | DiscoveredClusterSpec 定义所需的 DiscoveredCluster 状态。 | 请参阅 specs 列表 |
1.17.3.2. specs 列表
Name | 描述 | 模式 |
---|---|---|
activityTimestamp | DiscoveredClusters 最后可用活动时间戳。 | metav1.time |
apiUrl | DiscoveredClusters API URL 端点。 | 字符串 |
cloudProvider | 发现集群的云供应商。 | 字符串 |
console | DiscoveredClusters 控制台 URL 端点。 | 字符串 |
creationTimestamp | DiscoveredCluster 创建时间戳。 | metav1.time |
credential | 对从中发现集群的凭证的引用。 | corev1.ObjectReference |
displayName | 发现集群的显示名称。 | 字符串 |
isManagedCluster | 如果为 true,集群由 ACM 管理。 | 布尔值 |
name | discoveredcluster 的名称。 | 字符串 |
openshiftVersion | 发现集群的 OpenShift 版本。 | 字符串 |
status | 发现集群的状态。 | 字符串 |
type | OpenShift 类别(例如,OCP、ROSA 等)。 | 字符串 |