From 4dfad927a4950b71b96ca047f6abf642d5c30d27 Mon Sep 17 00:00:00 2001 From: Adrian Barsan Date: Thu, 4 Feb 2021 16:26:27 +0100 Subject: [PATCH] Generate with master (#70) --- client/apps/apps_client.go | 18 +++---- client/clusters/clusters_client.go | 2 +- client/key_pairs/key_pairs_client.go | 2 +- models/v4_app_spec_user_config_configmap.go | 2 +- models/v4_app_spec_user_config_secret.go | 2 +- models/v4_cluster_details_response_kvm.go | 7 +-- ...etails_response_kvm_port_mappings_items.go | 2 +- ...sponse_items_spec_user_config_configmap.go | 2 +- ..._response_items_spec_user_config_secret.go | 2 +- ...nfo_response_general_availability_zones.go | 2 +- models/v4_release_list_item.go | 5 +- ...5_add_node_pool_request_node_spec_azure.go | 31 +++++++++++ ..._request_node_spec_azure_spot_instances.go | 52 +++++++++++++++++++ models/v5_get_node_pool_response.go | 2 +- ..._get_node_pool_response_node_spec_azure.go | 31 +++++++++++ ...response_node_spec_azure_spot_instances.go | 50 ++++++++++++++++++ models/v5_get_node_pools_response_items.go | 2 +- ...de_pools_response_items_node_spec_azure.go | 31 +++++++++++ ...se_items_node_spec_azure_spot_instances.go | 50 ++++++++++++++++++ 19 files changed, 271 insertions(+), 24 deletions(-) create mode 100644 models/v5_add_node_pool_request_node_spec_azure_spot_instances.go create mode 100644 models/v5_get_node_pool_response_node_spec_azure_spot_instances.go create mode 100644 models/v5_get_node_pools_response_items_node_spec_azure_spot_instances.go diff --git a/client/apps/apps_client.go b/client/apps/apps_client.go index 63bb69a..86d578d 100644 --- a/client/apps/apps_client.go +++ b/client/apps/apps_client.go @@ -27,7 +27,7 @@ type Client struct { /* CreateClusterAppV4 installs an app v4 -Install an app on a tenant cluster by using this endpoint. +Install an app on a workload cluster by using this endpoint. For apps on v5 clusters, please use the v5 version of this endpoint. The spec field represents the app we'll be installing, and so spec.name refers to @@ -59,8 +59,8 @@ and check the status field of the app. ### About the user_config field in the response This field is not editable by you, but is set automatically by the API -if a ConfigMap named `{app_name}-user-values` exists in the tenant cluster -namespace on the control plane. +if a ConfigMap named `{app_name}-user-values` exists in the workload cluster +namespace on the management cluster. The `/v4/clusters/{cluster_id}/apps/{app_name}/config/` endpoints allows you to create such a ConfigMap using this API. @@ -76,7 +76,7 @@ correctly for you. It simplifies usage while also being a security measure. Furthermore it is also a security measure and ensures that users of this -API can't access arbitrary configmaps of the control plane. +API can't access arbitrary configmaps of the management cluster. This API will only allow you to edit or access configmaps that adhere to a strict naming convention. @@ -111,7 +111,7 @@ func (a *Client) CreateClusterAppV4(params *CreateClusterAppV4Params, authInfo r /* CreateClusterAppV5 installs an app v5 -Install an app on a tenant cluster by using this endpoint. +Install an app on a workload cluster by using this endpoint. The spec field represents the app we'll be installing, and so spec.name refers to the name of the app in the catalog. @@ -142,8 +142,8 @@ and check the status field of the app. ### About the user_config field in the response This field is not editable by you, but is set automatically by the API -if a ConfigMap named `{app_name}-user-values` exists in the tenant cluster -namespace on the control plane. +if a ConfigMap named `{app_name}-user-values` exists in the workload cluster +namespace on the management cluster. The `/v5/clusters/{cluster_id}/apps/{app_name}/config/` endpoints allows you to create such a ConfigMap using this API. @@ -159,7 +159,7 @@ correctly for you. It simplifies usage while also being a security measure. Furthermore it is also a security measure and ensures that users of this -API can't access arbitrary configmaps of the control plane. +API can't access arbitrary configmaps of the management cluster. This API will only allow you to edit or access configmaps that adhere to a strict naming convention. @@ -280,7 +280,7 @@ including a URL to fetch the full index of each catalog. some changes to the security settings of your cluster. App Catalogs can also be labeled as `internal`, however these catalogs - contain apps that run on our control planes. These `internal` app catalogs + contain apps that run on our management clusters. These `internal` app catalogs will be filtered out and never shown when calling this endpoint. For more details on app catalogs visit: https://docs.giantswarm.io/basics/app-catalog/ diff --git a/client/clusters/clusters_client.go b/client/clusters/clusters_client.go index 17c611a..89d6538 100644 --- a/client/clusters/clusters_client.go +++ b/client/clusters/clusters_client.go @@ -28,7 +28,7 @@ type Client struct { AddCluster creates cluster v4 This operation is used to create a new Kubernetes cluster or -"tenant cluster". +"workload cluster". ### Cluster definition diff --git a/client/key_pairs/key_pairs_client.go b/client/key_pairs/key_pairs_client.go index a26e035..286bd2b 100644 --- a/client/key_pairs/key_pairs_client.go +++ b/client/key_pairs/key_pairs_client.go @@ -33,7 +33,7 @@ A key pair consists of an unencrypted private RSA key and an X.509 certificate. In addition to the credentials itself, a key pair has some metadata like a unique ID, a creation timestamp and a free text `description` that you can use at will, for example to note for whom a key pair has been issued. -After creation of a tenant cluster, it might take a couple of seconds before this operation can be performed successfully. In this case, the API will respond with code 503, indicating that you should retry the call after some wait time. +After creation of a workload cluster, it might take a couple of seconds before this operation can be performed successfully. In this case, the API will respond with code 503, indicating that you should retry the call after some wait time. ### Customizing the certificate's subject for K8s RBAC diff --git a/models/v4_app_spec_user_config_configmap.go b/models/v4_app_spec_user_config_configmap.go index f2d3b72..a059a93 100644 --- a/models/v4_app_spec_user_config_configmap.go +++ b/models/v4_app_spec_user_config_configmap.go @@ -18,7 +18,7 @@ type V4AppSpecUserConfigConfigmap struct { // Name of the ConfigMap containing user-values to apply, e.g. prometheus-user-values Name string `json:"name,omitempty"` - // Namespace of the user-values ConfigMap on the control plane, e.g. 123ab + // Namespace of the user-values ConfigMap on the management cluster, e.g. 123ab Namespace string `json:"namespace,omitempty"` } diff --git a/models/v4_app_spec_user_config_secret.go b/models/v4_app_spec_user_config_secret.go index 14d7aa9..763e4a4 100644 --- a/models/v4_app_spec_user_config_secret.go +++ b/models/v4_app_spec_user_config_secret.go @@ -18,7 +18,7 @@ type V4AppSpecUserConfigSecret struct { // Name of the Secret containing user-secrets to apply, e.g. prometheus-user-secrets Name string `json:"name,omitempty"` - // Namespace of the user-secrets Secret on the control plane, e.g. 123ab + // Namespace of the user-secrets Secret on the management cluster, e.g. 123ab Namespace string `json:"namespace,omitempty"` } diff --git a/models/v4_cluster_details_response_kvm.go b/models/v4_cluster_details_response_kvm.go index e1f6bd8..6c6a21b 100644 --- a/models/v4_cluster_details_response_kvm.go +++ b/models/v4_cluster_details_response_kvm.go @@ -14,12 +14,13 @@ import ( "github.com/go-openapi/swag" ) -// V4ClusterDetailsResponseKvm Attributes specific to clusters running on KVM (on-prem) installations. +// V4ClusterDetailsResponseKvm Attributes specific to clusters running on KVM (on-premises) installations. // swagger:model v4ClusterDetailsResponseKvm type V4ClusterDetailsResponseKvm struct { - // Reveals the ports on the control plane that are mapped to this tenant cluster's ingress - // and which protocol that port supports. Only shown and relevant on our on-prem KVM clusters. + // Reveals the ports on the installation's load balancer that are mapped to this + // workload cluster's ingress and which protocol that port supports. Only shown + // and relevant on our on-premises KVM clusters. // PortMappings []*V4ClusterDetailsResponseKvmPortMappingsItems `json:"port_mappings"` } diff --git a/models/v4_cluster_details_response_kvm_port_mappings_items.go b/models/v4_cluster_details_response_kvm_port_mappings_items.go index 094d127..a38b389 100644 --- a/models/v4_cluster_details_response_kvm_port_mappings_items.go +++ b/models/v4_cluster_details_response_kvm_port_mappings_items.go @@ -15,7 +15,7 @@ import ( // swagger:model v4ClusterDetailsResponseKvmPortMappingsItems type V4ClusterDetailsResponseKvmPortMappingsItems struct { - // The port on the control plane that will forward traffic to the tenant cluster + // The port on the management cluster that will forward traffic to the workload cluster // Port int64 `json:"port,omitempty"` diff --git a/models/v4_get_cluster_apps_response_items_spec_user_config_configmap.go b/models/v4_get_cluster_apps_response_items_spec_user_config_configmap.go index b54c228..2fbd2b6 100644 --- a/models/v4_get_cluster_apps_response_items_spec_user_config_configmap.go +++ b/models/v4_get_cluster_apps_response_items_spec_user_config_configmap.go @@ -18,7 +18,7 @@ type V4GetClusterAppsResponseItemsSpecUserConfigConfigmap struct { // Name of the ConfigMap containing user-values to apply, e.g. prometheus-user-values Name string `json:"name,omitempty"` - // Namespace of the user-values ConfigMap on the control plane, e.g. 123ab + // Namespace of the user-values ConfigMap on the management cluster, e.g. 123ab Namespace string `json:"namespace,omitempty"` } diff --git a/models/v4_get_cluster_apps_response_items_spec_user_config_secret.go b/models/v4_get_cluster_apps_response_items_spec_user_config_secret.go index 6f601da..8f42b27 100644 --- a/models/v4_get_cluster_apps_response_items_spec_user_config_secret.go +++ b/models/v4_get_cluster_apps_response_items_spec_user_config_secret.go @@ -18,7 +18,7 @@ type V4GetClusterAppsResponseItemsSpecUserConfigSecret struct { // Name of the Secret containing user-secrets to apply, e.g. prometheus-user-secrets Name string `json:"name,omitempty"` - // Namespace of the user-secrets Secret on the control plane, e.g. 123ab + // Namespace of the user-secrets Secret on the management cluster, e.g. 123ab Namespace string `json:"namespace,omitempty"` } diff --git a/models/v4_info_response_general_availability_zones.go b/models/v4_info_response_general_availability_zones.go index f10398f..404596e 100644 --- a/models/v4_info_response_general_availability_zones.go +++ b/models/v4_info_response_general_availability_zones.go @@ -25,7 +25,7 @@ type V4InfoResponseGeneralAvailabilityZones struct { // Required: true Max *int64 `json:"max"` - // The availability zones available in the installation's region for use with tenant clusters. + // The availability zones available in the installation's region for use with workload clusters. Zones []string `json:"zones"` } diff --git a/models/v4_release_list_item.go b/models/v4_release_list_item.go index adcb3d3..cd0595b 100644 --- a/models/v4_release_list_item.go +++ b/models/v4_release_list_item.go @@ -19,9 +19,10 @@ import ( // swagger:model v4ReleaseListItem type V4ReleaseListItem struct { - // If true, the version is available for new clusters and cluster + // If `true`, the version is recommended for use in cluster creation and cluster // upgrades. Older versions become unavailable and thus have the - // value `false` here. + // value `false` here. Cluster creation with this version is still possible + // but not recommended. // // Required: true Active bool `json:"active"` diff --git a/models/v5_add_node_pool_request_node_spec_azure.go b/models/v5_add_node_pool_request_node_spec_azure.go index 0e333d4..13fbddd 100644 --- a/models/v5_add_node_pool_request_node_spec_azure.go +++ b/models/v5_add_node_pool_request_node_spec_azure.go @@ -8,6 +8,7 @@ package models import ( strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" "github.com/go-openapi/swag" ) @@ -16,6 +17,9 @@ import ( // swagger:model v5AddNodePoolRequestNodeSpecAzure type V5AddNodePoolRequestNodeSpecAzure struct { + // spot instances + SpotInstances *V5AddNodePoolRequestNodeSpecAzureSpotInstances `json:"spot_instances,omitempty"` + // Azure VM size to use for all nodes in the node pool. _(Validated against available VM sizes.)_ // VMSize string `json:"vm_size,omitempty"` @@ -23,6 +27,33 @@ type V5AddNodePoolRequestNodeSpecAzure struct { // Validate validates this v5 add node pool request node spec azure func (m *V5AddNodePoolRequestNodeSpecAzure) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSpotInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *V5AddNodePoolRequestNodeSpecAzure) validateSpotInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.SpotInstances) { // not required + return nil + } + + if m.SpotInstances != nil { + if err := m.SpotInstances.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("spot_instances") + } + return err + } + } + return nil } diff --git a/models/v5_add_node_pool_request_node_spec_azure_spot_instances.go b/models/v5_add_node_pool_request_node_spec_azure_spot_instances.go new file mode 100644 index 0000000..b1accab --- /dev/null +++ b/models/v5_add_node_pool_request_node_spec_azure_spot_instances.go @@ -0,0 +1,52 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// V5AddNodePoolRequestNodeSpecAzureSpotInstances Attributes defining the presence and configuration of Spot Instances. +// +// swagger:model v5AddNodePoolRequestNodeSpecAzureSpotInstances +type V5AddNodePoolRequestNodeSpecAzureSpotInstances struct { + + // Whether the feature is enabled or not. + // + Enabled *bool `json:"enabled,omitempty"` + + // The maximum price that a single node pool VM instance can reach before it is deallocated. + // By setting this value to `-1`, the maximum price will be fixed to the on-demand price of + // the instance. + // The value can be a floating point number with a maximum of 5 decimal places. + // + MaxPrice *float64 `json:"max_price,omitempty"` +} + +// Validate validates this v5 add node pool request node spec azure spot instances +func (m *V5AddNodePoolRequestNodeSpecAzureSpotInstances) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *V5AddNodePoolRequestNodeSpecAzureSpotInstances) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *V5AddNodePoolRequestNodeSpecAzureSpotInstances) UnmarshalBinary(b []byte) error { + var res V5AddNodePoolRequestNodeSpecAzureSpotInstances + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/v5_get_node_pool_response.go b/models/v5_get_node_pool_response.go index 23a1a69..0c261c5 100644 --- a/models/v5_get_node_pool_response.go +++ b/models/v5_get_node_pool_response.go @@ -20,7 +20,7 @@ type V5GetNodePoolResponse struct { // AvailabilityZones []string `json:"availability_zones"` - // Node pool identifier. Unique within a tenant cluster. + // Node pool identifier. Unique within a workload cluster. ID string `json:"id,omitempty"` // Node pool name diff --git a/models/v5_get_node_pool_response_node_spec_azure.go b/models/v5_get_node_pool_response_node_spec_azure.go index 0ad94a0..2a4ab30 100644 --- a/models/v5_get_node_pool_response_node_spec_azure.go +++ b/models/v5_get_node_pool_response_node_spec_azure.go @@ -8,6 +8,7 @@ package models import ( strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" "github.com/go-openapi/swag" ) @@ -16,6 +17,9 @@ import ( // swagger:model v5GetNodePoolResponseNodeSpecAzure type V5GetNodePoolResponseNodeSpecAzure struct { + // spot instances + SpotInstances *V5GetNodePoolResponseNodeSpecAzureSpotInstances `json:"spot_instances,omitempty"` + // Azure virtual machine size used by all nodes in this pool. // VMSize string `json:"vm_size,omitempty"` @@ -23,6 +27,33 @@ type V5GetNodePoolResponseNodeSpecAzure struct { // Validate validates this v5 get node pool response node spec azure func (m *V5GetNodePoolResponseNodeSpecAzure) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSpotInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *V5GetNodePoolResponseNodeSpecAzure) validateSpotInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.SpotInstances) { // not required + return nil + } + + if m.SpotInstances != nil { + if err := m.SpotInstances.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("spot_instances") + } + return err + } + } + return nil } diff --git a/models/v5_get_node_pool_response_node_spec_azure_spot_instances.go b/models/v5_get_node_pool_response_node_spec_azure_spot_instances.go new file mode 100644 index 0000000..08243c0 --- /dev/null +++ b/models/v5_get_node_pool_response_node_spec_azure_spot_instances.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// V5GetNodePoolResponseNodeSpecAzureSpotInstances Attributes defining the presence and configuration of Spot Instances. +// +// swagger:model v5GetNodePoolResponseNodeSpecAzureSpotInstances +type V5GetNodePoolResponseNodeSpecAzureSpotInstances struct { + + // Whether the feature is enabled or not. + // + Enabled bool `json:"enabled,omitempty"` + + // The maximum price that a single node pool VM instance can reach before it is deallocated. + // Find details on this attribute in the [addNodePool](#operation/addNodePool) operation. + // + MaxPrice float64 `json:"max_price,omitempty"` +} + +// Validate validates this v5 get node pool response node spec azure spot instances +func (m *V5GetNodePoolResponseNodeSpecAzureSpotInstances) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *V5GetNodePoolResponseNodeSpecAzureSpotInstances) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *V5GetNodePoolResponseNodeSpecAzureSpotInstances) UnmarshalBinary(b []byte) error { + var res V5GetNodePoolResponseNodeSpecAzureSpotInstances + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/v5_get_node_pools_response_items.go b/models/v5_get_node_pools_response_items.go index 4a5ae57..4356c4e 100644 --- a/models/v5_get_node_pools_response_items.go +++ b/models/v5_get_node_pools_response_items.go @@ -20,7 +20,7 @@ type V5GetNodePoolsResponseItems struct { // AvailabilityZones []string `json:"availability_zones"` - // Node pool identifier. Unique within a tenant cluster. + // Node pool identifier. Unique within a workload cluster. ID string `json:"id,omitempty"` // Node pool name diff --git a/models/v5_get_node_pools_response_items_node_spec_azure.go b/models/v5_get_node_pools_response_items_node_spec_azure.go index b02ad44..604d8a7 100644 --- a/models/v5_get_node_pools_response_items_node_spec_azure.go +++ b/models/v5_get_node_pools_response_items_node_spec_azure.go @@ -8,6 +8,7 @@ package models import ( strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/errors" "github.com/go-openapi/swag" ) @@ -16,6 +17,9 @@ import ( // swagger:model v5GetNodePoolsResponseItemsNodeSpecAzure type V5GetNodePoolsResponseItemsNodeSpecAzure struct { + // spot instances + SpotInstances *V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances `json:"spot_instances,omitempty"` + // Azure virtual machine size used by all nodes in this pool. // VMSize string `json:"vm_size,omitempty"` @@ -23,6 +27,33 @@ type V5GetNodePoolsResponseItemsNodeSpecAzure struct { // Validate validates this v5 get node pools response items node spec azure func (m *V5GetNodePoolsResponseItemsNodeSpecAzure) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSpotInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *V5GetNodePoolsResponseItemsNodeSpecAzure) validateSpotInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.SpotInstances) { // not required + return nil + } + + if m.SpotInstances != nil { + if err := m.SpotInstances.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("spot_instances") + } + return err + } + } + return nil } diff --git a/models/v5_get_node_pools_response_items_node_spec_azure_spot_instances.go b/models/v5_get_node_pools_response_items_node_spec_azure_spot_instances.go new file mode 100644 index 0000000..de844f7 --- /dev/null +++ b/models/v5_get_node_pools_response_items_node_spec_azure_spot_instances.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances Attributes defining the presence and configuration of Spot Instances. +// +// swagger:model v5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances +type V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances struct { + + // Whether the feature is enabled or not. + // + Enabled bool `json:"enabled,omitempty"` + + // The maximum price that a single node pool VM instance can reach before it is deallocated. + // Find details on this attribute in the [addNodePool](#operation/addNodePool) operation. + // + MaxPrice float64 `json:"max_price,omitempty"` +} + +// Validate validates this v5 get node pools response items node spec azure spot instances +func (m *V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances) UnmarshalBinary(b []byte) error { + var res V5GetNodePoolsResponseItemsNodeSpecAzureSpotInstances + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}