F5 Distributed Cloud Services API for ves.io.schema.virtual_k8s
Download OpenAPI specification:Download
Virtual K8s object exposes a Kubernetes API endpoint in the namespace that operates on all the physical Kubernetes clusters in each of the sites that are selected by the virtual-site referred to in the object.
Virtual K8s supports only a subset of Kubernetes APIs related to application management.
Read and write operations are currently supported on the following Kubernetes API resources:
- Deployment v1 apps
- StatefulSet v1 apps
- DaemonSet v1 apps
- Job v1 batch
- CronJob v1beta1 batch
- Service v1 core with type ClusterIP
- Secret v1 core
- ConfigMap v1 core
- ServiceAccount v1 core
- PersistentVolumeClaim v1 core
Only delete is supported on Pod v1 core.
Read only operations are currently supported on the following Kubernetes API resources:
- Pod v1 core
- ReplicaSet v1 apps
- Endpoints v1 core
- Node v1 core
- Namespace v1 core
- PersistentVolume v1 core
- Event v1 core
The semantics of using Kubernetes APIs on a Virtual K8s object are different compared to those on a single Kubernetes cluster since the Kubernetes resource objects created using the Virtual K8s API will be instantiated in all the physical Kubernetes clusters in each of the sites selected by the virtual-site referred to in the object. In a single Kubernetes cluster, when a Deployment resource is created with Replicas set to 3, the expectation is that 3 Pods will be created on the Kubernetes cluster. On the Virtual K8S API, when a Deployment resource is created with Replicas set to 3, the total number of Pods created is equal to the number of Replicas times the number of physical clusters in each of the sites selected by the referred to virtual-site. For example, if the virtual-site associated with Virtual K8s object selects 3 sites each having 1 physical Kubernetes cluster, then the total number of Pods created will be 9.
Kubernetes API resource objects can also be created with the annotation ves.io/virtual-sites=
Create Virtual Kubernetes
Create virtual_k8s will create the object in the storage backend for namespace metadata.namespace
path Parameters
metadata.namespace required | string namespace x-example: "staging" This defines the workspace within which each the configuration object is to be created. Must be a DNS_LABEL format. For a namespace object itself, namespace value will be "" |
Request Body schema: application/jsonrequired
object (ObjectCreateMetaType) ObjectCreateMetaType is metadata that can be specified in Create request of an object. | |
object (Create Virtual K8s) Create virtual_k8s will create the object in the storage backend for namespace metadata.namespace |
Responses
Request samples
- Payload
{- "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}
}
Response samples
- 200
- 401
- 403
- 404
- 409
- 429
- 500
- 503
- 504
{- "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}, - "system_metadata": {
- "creation_timestamp": "2019-08-24T14:15:22Z",
- "creator_class": "string",
- "creator_id": "string",
- "deletion_timestamp": "2019-08-24T14:15:22Z",
- "finalizers": [
- "string"
], - "initializers": {
- "pending": [
- {
- "name": "string"
}
], - "result": {
- "code": 0,
- "reason": "string",
- "status": "string"
}
}, - "labels": { },
- "modification_timestamp": "2019-08-24T14:15:22Z",
- "object_index": 0,
- "owner_view": {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "uid": "string"
}, - "tenant": "string",
- "uid": "string"
}
}
Replace Virtual Kubernetes
Replacing an endpoint object will update the object by replacing the existing spec with the provided one. For read-then-write operations a resourceVersion mismatch will occur if the object was modified between the read and write.
path Parameters
metadata.namespace required | string namespace x-example: "staging" This defines the workspace within which each the configuration object is to be created. Must be a DNS_LABEL format. For a namespace object itself, namespace value will be "" |
metadata.name required | string name x-example: "acmecorp-web" The configuration object to be replaced will be looked up by name |
Request Body schema: application/jsonrequired
object (ObjectReplaceMetaType) ObjectReplaceMetaType is metadata that can be specified in Replace request of an object. | |
object (Replace Virtual K8s) Replacing an endpoint object will update the object by replacing the existing spec with the provided one. For read-then-write operations a resourceVersion mismatch will occur if the object was modified between the read and write. |
Responses
Request samples
- Payload
{- "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}
}
Response samples
- 200
- 401
- 403
- 404
- 409
- 429
- 500
- 503
- 504
{ }
PVC Metrics
API to get PVC capacity/usage.
path Parameters
namespace required | string Namespace x-example: "ns1" |
Request Body schema: application/jsonrequired
end_time | string (End time) end time of metric collection from which data will be considered to build graph. Format: unix_timestamp|rfc 3339 Optional: If not specified, then the end_time will be evaluated to start_time+10m
If start_time is not specified, then the end_time will be evaluated to Example: Validation Rules: ves.io.schema.rules.string.query_time: true |
field_selector | Array of strings (Field Selector) [ 1 .. 8 ] items Items Enum: "PVC_USAGE" "PVC_CAPACITY" Select fields to be returned in the response. One or more fields in {PVC_USAGE, PVC_CAPACITY} can be specified. Required: YES Validation Rules: ves.io.schema.rules.message.required: true ves.io.schema.rules.repeated.max_items: 8 ves.io.schema.rules.repeated.min_items: 1 ves.io.schema.rules.repeated.unique: true |
filter | string (Label Filter) filter is used to specify the list of matchers
syntax for filter := {[ Optional: If not specified, metric will be aggregated based on the group_by labels. Example: |
group_by | Array of strings (Group by) Items Enum: "NAMESPACE" "PVC" "SITE" Aggregate data by zero or more labels {NAMESPACE, PVC, SITE} |
namespace | string (Namespace) Example: |
range | string (Range) range decides how far to go back in time to fetch values for each step. For example, if the range is 5m, then for step t1, query will be evaluated for t1-5m and for t2, query will be evaluated for t2-5m and so on. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days Note: For non-timeseries query, i.e., for step=end_time-start_time, range should be set to end_time-start_time Optional: If not specified, range is set to 5m Example: Validation Rules: ves.io.schema.rules.string.time_interval: true |
start_time | string (Start time) start time of metric collection from which data will be considered to build graph. Format: unix_timestamp|rfc 3339 Optional: If not specified, then the start_time will be evaluated to end_time-10m
If end_time is not specified, then the start_time will be evaluated to Example: Validation Rules: ves.io.schema.rules.string.query_time: true |
step | string (Step) step is the resolution width, which determines the number of the data points [x-axis (time)] to be returned in the response. The timestamps in the response will be t1=start_time, t2=t1+step, ... tn=tn-1+step, where tn <= end_time. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days Optional: If not specified, then step size is evaluated to <end_time - start_time> Example: Validation Rules: ves.io.schema.rules.string.query_step: true |
Responses
Request samples
- Payload
{- "end_time": "string",
- "field_selector": [
- "PVC_USAGE"
], - "filter": "string",
- "group_by": [
- "NAMESPACE"
], - "namespace": "string",
- "range": "string",
- "start_time": "string",
- "step": "string"
}
Response samples
- 200
- 401
- 403
- 404
- 409
- 429
- 500
- 503
- 504
{- "data": [
- {
- "data": [
- {
- "key": { },
- "value": [
- {
- "timestamp": 0.1,
- "trend_value": {
- "description": "string",
- "previous_value": "string",
- "sentiment": "TREND_SENTIMENT_NONE",
- "value": "string"
}, - "value": "string"
}
]
}
], - "type": "PVC_USAGE",
- "unit": "UNIT_MILLISECONDS"
}
], - "step": "string"
}
List Virtual Kubernetes
List the set of virtual_k8s in a namespace
path Parameters
namespace required | string namespace x-example: "ns1" Namespace to scope the listing of virtual_k8s |
query Parameters
label_filter | string x-example: "env in (staging, testing), tier in (web, db)" A LabelSelectorType expression that every item in list response will satisfy |
report_fields | Array of strings x-example: "" Extra fields to return along with summary fields |
report_status_fields | Array of strings x-example: "" Extra status fields to return along with summary fields |
Responses
Response samples
- 200
- 401
- 403
- 404
- 409
- 429
- 500
- 503
- 504
{- "errors": [
- {
- "code": "EOK",
- "error_obj": {
- "type_url": "string",
- "value": "string"
}, - "message": "string"
}
], - "items": [
- {
- "annotations": { },
- "description": "string",
- "disabled": true,
- "get_spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}, - "labels": { },
- "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "name": "string",
- "namespace": "string",
- "owner_view": {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "uid": "string"
}, - "status_set": [
- {
- "conditions": [
- {
- "hostname": "string",
- "last_update_time": "2019-08-24T14:15:22Z",
- "reason": "string",
- "service_name": "string",
- "status": "string",
- "type": "string"
}
], - "metadata": {
- "creation_timestamp": "2019-08-24T14:15:22Z",
- "creator_class": "string",
- "creator_id": "string",
- "publish": "STATUS_DO_NOT_PUBLISH",
- "status_id": "string",
- "uid": "string",
- "vtrp_id": "string",
- "vtrp_stale": true
}, - "object_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}
], - "system_metadata": {
- "creation_timestamp": "2019-08-24T14:15:22Z",
- "creator_class": "string",
- "creator_id": "string",
- "deletion_timestamp": "2019-08-24T14:15:22Z",
- "finalizers": [
- "string"
], - "initializers": {
- "pending": [
- {
- "name": "string"
}
], - "result": {
- "code": 0,
- "reason": "string",
- "status": "string"
}
}, - "labels": { },
- "modification_timestamp": "2019-08-24T14:15:22Z",
- "object_index": 0,
- "owner_view": {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "uid": "string"
}, - "tenant": "string",
- "uid": "string"
}, - "tenant": "string",
- "uid": "string"
}
]
}
Get Virtual Kubernetes
Get virtual_k8s will get the object from the storage backend for namesapce metadata.namespace
path Parameters
namespace required | string namespace x-example: "ns1" The namespace in which the configuration object is present |
name required | string name x-example: "name" The name of the configuration object to be fetched |
query Parameters
response_format | string Default: "GET_RSP_FORMAT_DEFAULT" Enum: "GET_RSP_FORMAT_DEFAULT" "GET_RSP_FORMAT_FOR_CREATE" "GET_RSP_FORMAT_FOR_REPLACE" "GET_RSP_FORMAT_STATUS" "GET_RSP_FORMAT_READ" "GET_RSP_FORMAT_REFERRING_OBJECTS" "GET_RSP_FORMAT_BROKEN_REFERENCES" The format in which the configuration object is to be fetched. This could be for example - in GetSpec form for the contents of object - in CreateRequest form to create a new similar object - to ReplaceRequest form to replace changeable values Default format of returned resource Response should be in CreateRequest format Response should be in ReplaceRequest format Response should be in StatusObject(s) format Response should be in format of GetSpecType Response should have other objects referring to this object Response should have deleted and disabled objects referrred by this object |
Responses
Response samples
- 200
- 401
- 403
- 404
- 409
- 429
- 500
- 503
- 504
{- "create_form": {
- "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}
}, - "deleted_referred_objects": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
], - "disabled_referred_objects": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
], - "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "referring_objects": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
], - "replace_form": {
- "metadata": {
- "annotations": { },
- "description": "string",
- "disable": true,
- "labels": { },
- "name": "string",
- "namespace": "string"
}, - "spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}
}, - "spec": {
- "default_flavor_ref": {
- "name": "string",
- "namespace": "string",
- "tenant": "string"
}, - "disabled": { },
- "isolated": { },
- "vsite_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}, - "status": [
- {
- "conditions": [
- {
- "hostname": "string",
- "last_update_time": "2019-08-24T14:15:22Z",
- "reason": "string",
- "service_name": "string",
- "status": "string",
- "type": "string"
}
], - "metadata": {
- "creation_timestamp": "2019-08-24T14:15:22Z",
- "creator_class": "string",
- "creator_id": "string",
- "publish": "STATUS_DO_NOT_PUBLISH",
- "status_id": "string",
- "uid": "string",
- "vtrp_id": "string",
- "vtrp_stale": true
}, - "object_refs": [
- {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "tenant": "string",
- "uid": "string"
}
]
}
], - "system_metadata": {
- "creation_timestamp": "2019-08-24T14:15:22Z",
- "creator_class": "string",
- "creator_id": "string",
- "deletion_timestamp": "2019-08-24T14:15:22Z",
- "finalizers": [
- "string"
], - "initializers": {
- "pending": [
- {
- "name": "string"
}
], - "result": {
- "code": 0,
- "reason": "string",
- "status": "string"
}
}, - "labels": { },
- "modification_timestamp": "2019-08-24T14:15:22Z",
- "object_index": 0,
- "owner_view": {
- "kind": "string",
- "name": "string",
- "namespace": "string",
- "uid": "string"
}, - "tenant": "string",
- "uid": "string"
}
}
Delete Virtual Kubernetes
Delete the specified virtual_k8s
path Parameters
namespace required | string namespace x-example: "ns1" Namespace in which the configuration object is present |
name required | string name x-example: "name" Name of the configuration object |
Request Body schema: application/jsonrequired
fail_if_referred | boolean <boolean> (fail_if_referred) Fail the delete operation if this object is being referred by other objects |
name | string (name) Name of the configuration object Example: |
namespace | string (namespace) Namespace in which the configuration object is present Example: |
Responses
Request samples
- Payload
{- "fail_if_referred": true,
- "name": "string",
- "namespace": "string"
}
Response samples
- 200
- 401
- 403
- 404
- 409
- 429
- 500
- 503
- 504
null