diff --git a/console/service/api/swagger.yaml b/console/service/api/swagger.yaml index e37453431..f378b7643 100644 --- a/console/service/api/swagger.yaml +++ b/console/service/api/swagger.yaml @@ -85,7 +85,6 @@ paths: description: Error schema: $ref: "#/definitions/Response.Error" - /environments: get: summary: "Get environments list" diff --git a/console/service/models/cluster_info.go b/console/service/models/cluster_info.go deleted file mode 100644 index 233223846..000000000 --- a/console/service/models/cluster_info.go +++ /dev/null @@ -1,170 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ClusterInfo Cluster info -// -// swagger:model ClusterInfo -type ClusterInfo struct { - - // Code of location - // Example: eu-north-1 - ClusterLocation string `json:"cluster_location,omitempty"` - - // connection info - ConnectionInfo interface{} `json:"connection_info,omitempty"` - - // creation time - // Example: 16.10.2023T11:20:00Z - // Format: date-time - CreationTime strfmt.DateTime `json:"creation_time,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // environment - // Example: production - Environment string `json:"environment,omitempty"` - - // id - ID int64 `json:"id,omitempty"` - - // name - // Example: drm-prod-pgcluster - Name string `json:"name,omitempty"` - - // postgres version - // Example: 15 - PostgresVersion int32 `json:"postgres_version,omitempty"` - - // Project for cluster - ProjectName string `json:"project_name,omitempty"` - - // servers - Servers []*ClusterInfoInstance `json:"servers"` - - // status - // Example: healthy - Status string `json:"status,omitempty"` -} - -// Validate validates this cluster info -func (m *ClusterInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreationTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServers(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClusterInfo) validateCreationTime(formats strfmt.Registry) error { - if swag.IsZero(m.CreationTime) { // not required - return nil - } - - if err := validate.FormatOf("creation_time", "body", "date-time", m.CreationTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ClusterInfo) validateServers(formats strfmt.Registry) error { - if swag.IsZero(m.Servers) { // not required - return nil - } - - for i := 0; i < len(m.Servers); i++ { - if swag.IsZero(m.Servers[i]) { // not required - continue - } - - if m.Servers[i] != nil { - if err := m.Servers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("servers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("servers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this cluster info based on the context it is used -func (m *ClusterInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServers(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClusterInfo) contextValidateServers(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Servers); i++ { - - if m.Servers[i] != nil { - if err := m.Servers[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("servers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("servers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ClusterInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClusterInfo) UnmarshalBinary(b []byte) error { - var res ClusterInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/cluster_info_additional_settings.go b/console/service/models/cluster_info_additional_settings.go deleted file mode 100644 index 4b02d0dd3..000000000 --- a/console/service/models/cluster_info_additional_settings.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ClusterInfoAdditionalSettings Additional settings for cluster -// -// swagger:model ClusterInfo.AdditionalSettings -type ClusterInfoAdditionalSettings struct { - - // connection info - ConnectionInfo interface{} `json:"connection_info,omitempty"` -} - -// Validate validates this cluster info additional settings -func (m *ClusterInfoAdditionalSettings) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this cluster info additional settings based on context it is used -func (m *ClusterInfoAdditionalSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ClusterInfoAdditionalSettings) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClusterInfoAdditionalSettings) UnmarshalBinary(b []byte) error { - var res ClusterInfoAdditionalSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/cluster_info_instance.go b/console/service/models/cluster_info_instance.go deleted file mode 100644 index 1a97c3868..000000000 --- a/console/service/models/cluster_info_instance.go +++ /dev/null @@ -1,80 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ClusterInfoInstance Instance info for current cluster -// -// swagger:model ClusterInfo.Instance -type ClusterInfoInstance struct { - - // id - ID int64 `json:"id,omitempty"` - - // ip - // Example: 10.128.64.141 - IP string `json:"ip,omitempty"` - - // lag - // Example: 0 - Lag *int64 `json:"lag,omitempty"` - - // name - // Example: pgnode1 - Name string `json:"name,omitempty"` - - // pending restart - // Example: false - PendingRestart *bool `json:"pending_restart,omitempty"` - - // role - // Example: leader - Role string `json:"role,omitempty"` - - // status - Status string `json:"status,omitempty"` - - // tags - Tags interface{} `json:"tags,omitempty"` - - // timeline - // Example: 1 - Timeline *int64 `json:"timeline,omitempty"` -} - -// Validate validates this cluster info instance -func (m *ClusterInfoInstance) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this cluster info instance based on context it is used -func (m *ClusterInfoInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ClusterInfoInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClusterInfoInstance) UnmarshalBinary(b []byte) error { - var res ClusterInfoInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/deployment_cloud_image.go b/console/service/models/deployment_cloud_image.go deleted file mode 100644 index 0bd4a7877..000000000 --- a/console/service/models/deployment_cloud_image.go +++ /dev/null @@ -1,90 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeploymentCloudImage deployment cloud image -// -// swagger:model Deployment.CloudImage -type DeploymentCloudImage struct { - - // arch - // Example: amd64 - Arch string `json:"arch,omitempty"` - - // image - // Example: {\"server_image\": \"ami-078b3985bbc361448\"} - Image interface{} `json:"image,omitempty"` - - // os name - // Example: Ubuntu - OsName string `json:"os_name,omitempty"` - - // os version - // Example: 22.04 LTS - OsVersion string `json:"os_version,omitempty"` - - // updated at - // Format: datetime - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` -} - -// Validate validates this deployment cloud image -func (m *DeploymentCloudImage) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeploymentCloudImage) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "datetime", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this deployment cloud image based on context it is used -func (m *DeploymentCloudImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeploymentCloudImage) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeploymentCloudImage) UnmarshalBinary(b []byte) error { - var res DeploymentCloudImage - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/deployment_info_cloud_region.go b/console/service/models/deployment_info_cloud_region.go deleted file mode 100644 index cca8921f3..000000000 --- a/console/service/models/deployment_info_cloud_region.go +++ /dev/null @@ -1,222 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeploymentInfoCloudRegion deployment info cloud region -// -// swagger:model DeploymentInfo.CloudRegion -type DeploymentInfoCloudRegion struct { - - // unique parameter for DB - // Example: north_america - Code string `json:"code,omitempty"` - - // List of datacenters for this region - Datacenters []*DeploymentInfoCloudRegionDatacentersItems0 `json:"datacenters"` - - // Field for web - // Example: North America - Name string `json:"name,omitempty"` -} - -// Validate validates this deployment info cloud region -func (m *DeploymentInfoCloudRegion) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDatacenters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeploymentInfoCloudRegion) validateDatacenters(formats strfmt.Registry) error { - if swag.IsZero(m.Datacenters) { // not required - return nil - } - - for i := 0; i < len(m.Datacenters); i++ { - if swag.IsZero(m.Datacenters[i]) { // not required - continue - } - - if m.Datacenters[i] != nil { - if err := m.Datacenters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this deployment info cloud region based on the context it is used -func (m *DeploymentInfoCloudRegion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDatacenters(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeploymentInfoCloudRegion) contextValidateDatacenters(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Datacenters); i++ { - - if m.Datacenters[i] != nil { - if err := m.Datacenters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeploymentInfoCloudRegion) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeploymentInfoCloudRegion) UnmarshalBinary(b []byte) error { - var res DeploymentInfoCloudRegion - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// DeploymentInfoCloudRegionDatacentersItems0 deployment info cloud region datacenters items0 -// -// swagger:model DeploymentInfoCloudRegionDatacentersItems0 -type DeploymentInfoCloudRegionDatacentersItems0 struct { - - // cloud image - CloudImage *DeploymentCloudImage `json:"cloud_image,omitempty"` - - // code - // Example: ca-central-1 - Code string `json:"code,omitempty"` - - // location - // Example: Canada (central) - Location string `json:"location,omitempty"` -} - -// Validate validates this deployment info cloud region datacenters items0 -func (m *DeploymentInfoCloudRegionDatacentersItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudImage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeploymentInfoCloudRegionDatacentersItems0) validateCloudImage(formats strfmt.Registry) error { - if swag.IsZero(m.CloudImage) { // not required - return nil - } - - if m.CloudImage != nil { - if err := m.CloudImage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloud_image") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloud_image") - } - return err - } - } - - return nil -} - -// ContextValidate validate this deployment info cloud region datacenters items0 based on the context it is used -func (m *DeploymentInfoCloudRegionDatacentersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCloudImage(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeploymentInfoCloudRegionDatacentersItems0) contextValidateCloudImage(ctx context.Context, formats strfmt.Registry) error { - - if m.CloudImage != nil { - if err := m.CloudImage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloud_image") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloud_image") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeploymentInfoCloudRegionDatacentersItems0) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeploymentInfoCloudRegionDatacentersItems0) UnmarshalBinary(b []byte) error { - var res DeploymentInfoCloudRegionDatacentersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/deployment_instance_type.go b/console/service/models/deployment_instance_type.go deleted file mode 100644 index 4be9bf8e6..000000000 --- a/console/service/models/deployment_instance_type.go +++ /dev/null @@ -1,71 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeploymentInstanceType deployment instance type -// -// swagger:model Deployment.InstanceType -type DeploymentInstanceType struct { - - // code - // Example: m5.2xlarge - Code string `json:"code,omitempty"` - - // cpu - // Example: 8 - CPU int64 `json:"cpu,omitempty"` - - // Price currency - // Example: $ - Currency string `json:"currency,omitempty"` - - // Price for 1 instance by hour - // Example: 0.01 - PriceHourly float64 `json:"price_hourly,omitempty"` - - // Price for 1 instance by month - // Example: 1.2 - PriceMonthly float64 `json:"price_monthly,omitempty"` - - // ram - // Example: 256 - RAM int64 `json:"ram,omitempty"` -} - -// Validate validates this deployment instance type -func (m *DeploymentInstanceType) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this deployment instance type based on context it is used -func (m *DeploymentInstanceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeploymentInstanceType) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeploymentInstanceType) UnmarshalBinary(b []byte) error { - var res DeploymentInstanceType - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/meta_pagination.go b/console/service/models/meta_pagination.go deleted file mode 100644 index e52271aed..000000000 --- a/console/service/models/meta_pagination.go +++ /dev/null @@ -1,56 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MetaPagination Pagination info for list requests -// -// swagger:model Meta.Pagination -type MetaPagination struct { - - // count - Count *int64 `json:"count,omitempty"` - - // limit - Limit *int64 `json:"limit,omitempty"` - - // offset - Offset *int64 `json:"offset,omitempty"` -} - -// Validate validates this meta pagination -func (m *MetaPagination) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this meta pagination based on context it is used -func (m *MetaPagination) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MetaPagination) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MetaPagination) UnmarshalBinary(b []byte) error { - var res MetaPagination - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_change_setting.go b/console/service/models/request_change_setting.go deleted file mode 100644 index 5a0a053b9..000000000 --- a/console/service/models/request_change_setting.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestChangeSetting Change setting -// -// swagger:model Request.ChangeSetting -type RequestChangeSetting struct { - - // value - Value interface{} `json:"value,omitempty"` -} - -// Validate validates this request change setting -func (m *RequestChangeSetting) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request change setting based on context it is used -func (m *RequestChangeSetting) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestChangeSetting) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestChangeSetting) UnmarshalBinary(b []byte) error { - var res RequestChangeSetting - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_cluster_create.go b/console/service/models/request_cluster_create.go deleted file mode 100644 index 195764990..000000000 --- a/console/service/models/request_cluster_create.go +++ /dev/null @@ -1,161 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestClusterCreate Request struct for cluster creation -// -// swagger:model Request.ClusterCreate -type RequestClusterCreate struct { - - // auth info - AuthInfo *RequestClusterCreateAuthInfo `json:"auth_info,omitempty"` - - // Info about cluster - Description string `json:"description,omitempty"` - - // Project environment - EnvironmentID int64 `json:"environment_id,omitempty"` - - // envs - Envs []string `json:"envs"` - - // extra vars - ExtraVars []string `json:"extra_vars"` - - // name - // Example: drm-prod-pgcluster - Name string `json:"name,omitempty"` - - // Project for new cluster - ProjectID int64 `json:"project_id,omitempty"` -} - -// Validate validates this request cluster create -func (m *RequestClusterCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthInfo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestClusterCreate) validateAuthInfo(formats strfmt.Registry) error { - if swag.IsZero(m.AuthInfo) { // not required - return nil - } - - if m.AuthInfo != nil { - if err := m.AuthInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("auth_info") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("auth_info") - } - return err - } - } - - return nil -} - -// ContextValidate validate this request cluster create based on the context it is used -func (m *RequestClusterCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestClusterCreate) contextValidateAuthInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.AuthInfo != nil { - if err := m.AuthInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("auth_info") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("auth_info") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RequestClusterCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestClusterCreate) UnmarshalBinary(b []byte) error { - var res RequestClusterCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// RequestClusterCreateAuthInfo Info for deployment system authorization -// -// swagger:model RequestClusterCreateAuthInfo -type RequestClusterCreateAuthInfo struct { - - // secret id - // Example: 1 - SecretID int64 `json:"secret_id,omitempty"` -} - -// Validate validates this request cluster create auth info -func (m *RequestClusterCreateAuthInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request cluster create auth info based on context it is used -func (m *RequestClusterCreateAuthInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestClusterCreateAuthInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestClusterCreateAuthInfo) UnmarshalBinary(b []byte) error { - var res RequestClusterCreateAuthInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_cluster_reinit.go b/console/service/models/request_cluster_reinit.go deleted file mode 100644 index 0491689df..000000000 --- a/console/service/models/request_cluster_reinit.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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 - -// RequestClusterReinit Reinit cluster -// -// swagger:model Request.ClusterReinit -type RequestClusterReinit interface{} diff --git a/console/service/models/request_cluster_reload.go b/console/service/models/request_cluster_reload.go deleted file mode 100644 index 57fc4354c..000000000 --- a/console/service/models/request_cluster_reload.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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 - -// RequestClusterReload Reload cluster -// -// swagger:model Request.ClusterReload -type RequestClusterReload interface{} diff --git a/console/service/models/request_cluster_remove.go b/console/service/models/request_cluster_remove.go deleted file mode 100644 index 7eb574a52..000000000 --- a/console/service/models/request_cluster_remove.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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 - -// RequestClusterRemove Remove cluster -// -// swagger:model Request.ClusterRemove -type RequestClusterRemove interface{} diff --git a/console/service/models/request_cluster_restart.go b/console/service/models/request_cluster_restart.go deleted file mode 100644 index fbcba61bd..000000000 --- a/console/service/models/request_cluster_restart.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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 - -// RequestClusterRestart Restart cluster -// -// swagger:model Request.ClusterRestart -type RequestClusterRestart interface{} diff --git a/console/service/models/request_cluster_start.go b/console/service/models/request_cluster_start.go deleted file mode 100644 index 666099543..000000000 --- a/console/service/models/request_cluster_start.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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 - -// RequestClusterStart Start cluster -// -// swagger:model Request.ClusterStart -type RequestClusterStart interface{} diff --git a/console/service/models/request_cluster_stop.go b/console/service/models/request_cluster_stop.go deleted file mode 100644 index f9eceb26c..000000000 --- a/console/service/models/request_cluster_stop.go +++ /dev/null @@ -1,11 +0,0 @@ -// 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 - -// RequestClusterStop Stop cluster -// -// swagger:model Request.ClusterStop -type RequestClusterStop interface{} diff --git a/console/service/models/request_create_setting.go b/console/service/models/request_create_setting.go deleted file mode 100644 index 62c9d4288..000000000 --- a/console/service/models/request_create_setting.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestCreateSetting Create new setting -// -// swagger:model Request.CreateSetting -type RequestCreateSetting struct { - - // name - Name string `json:"name,omitempty"` - - // value - Value interface{} `json:"value,omitempty"` -} - -// Validate validates this request create setting -func (m *RequestCreateSetting) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request create setting based on context it is used -func (m *RequestCreateSetting) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestCreateSetting) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestCreateSetting) UnmarshalBinary(b []byte) error { - var res RequestCreateSetting - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_environment.go b/console/service/models/request_environment.go deleted file mode 100644 index 8f37d7ec4..000000000 --- a/console/service/models/request_environment.go +++ /dev/null @@ -1,55 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestEnvironment request environment -// -// swagger:model Request.Environment -type RequestEnvironment struct { - - // description - // Example: environment for production - Description string `json:"description,omitempty"` - - // name - // Example: production - Name string `json:"name,omitempty"` -} - -// Validate validates this request environment -func (m *RequestEnvironment) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request environment based on context it is used -func (m *RequestEnvironment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestEnvironment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestEnvironment) UnmarshalBinary(b []byte) error { - var res RequestEnvironment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_project_create.go b/console/service/models/request_project_create.go deleted file mode 100644 index 7d21b9ce8..000000000 --- a/console/service/models/request_project_create.go +++ /dev/null @@ -1,55 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestProjectCreate request project create -// -// swagger:model Request.ProjectCreate -type RequestProjectCreate struct { - - // description - // Example: Default project - Description string `json:"description,omitempty"` - - // name - // Example: default - Name string `json:"name,omitempty"` -} - -// Validate validates this request project create -func (m *RequestProjectCreate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request project create based on context it is used -func (m *RequestProjectCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestProjectCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestProjectCreate) UnmarshalBinary(b []byte) error { - var res RequestProjectCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_project_patch.go b/console/service/models/request_project_patch.go deleted file mode 100644 index 170438db8..000000000 --- a/console/service/models/request_project_patch.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestProjectPatch request project patch -// -// swagger:model Request.ProjectPatch -type RequestProjectPatch struct { - - // description - Description *string `json:"description,omitempty"` - - // name - Name *string `json:"name,omitempty"` -} - -// Validate validates this request project patch -func (m *RequestProjectPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request project patch based on context it is used -func (m *RequestProjectPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestProjectPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestProjectPatch) UnmarshalBinary(b []byte) error { - var res RequestProjectPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_create.go b/console/service/models/request_secret_create.go deleted file mode 100644 index 06619ec58..000000000 --- a/console/service/models/request_secret_create.go +++ /dev/null @@ -1,154 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretCreate request secret create -// -// swagger:model Request.SecretCreate -type RequestSecretCreate struct { - - // name - // Example: aws key - Name string `json:"name,omitempty"` - - // project id - // Example: 1 - ProjectID int64 `json:"project_id,omitempty"` - - // type - Type SecretType `json:"type,omitempty"` - - // value - Value *RequestSecretValue `json:"value,omitempty"` -} - -// Validate validates this request secret create -func (m *RequestSecretCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestSecretCreate) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -func (m *RequestSecretCreate) validateValue(formats strfmt.Registry) error { - if swag.IsZero(m.Value) { // not required - return nil - } - - if m.Value != nil { - if err := m.Value.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("value") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("value") - } - return err - } - } - - return nil -} - -// ContextValidate validate this request secret create based on the context it is used -func (m *RequestSecretCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateValue(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestSecretCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -func (m *RequestSecretCreate) contextValidateValue(ctx context.Context, formats strfmt.Registry) error { - - if m.Value != nil { - if err := m.Value.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("value") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("value") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretCreate) UnmarshalBinary(b []byte) error { - var res RequestSecretCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_patch.go b/console/service/models/request_secret_patch.go deleted file mode 100644 index e981ec55b..000000000 --- a/console/service/models/request_secret_patch.go +++ /dev/null @@ -1,59 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretPatch request secret patch -// -// swagger:model Request.SecretPatch -type RequestSecretPatch struct { - - // name - // Example: aws key - Name *string `json:"name,omitempty"` - - // type - // Example: aws - Type *string `json:"type,omitempty"` - - // Secret value in base64 - // Example: c2VjcmV0 - Value *string `json:"value,omitempty"` -} - -// Validate validates this request secret patch -func (m *RequestSecretPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret patch based on context it is used -func (m *RequestSecretPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretPatch) UnmarshalBinary(b []byte) error { - var res RequestSecretPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value.go b/console/service/models/request_secret_value.go deleted file mode 100644 index 7fc4e43f6..000000000 --- a/console/service/models/request_secret_value.go +++ /dev/null @@ -1,380 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValue request secret value -// -// swagger:model Request.SecretValue -type RequestSecretValue struct { - - // aws - Aws *RequestSecretValueAws `json:"aws,omitempty"` - - // azure - Azure *RequestSecretValueAzure `json:"azure,omitempty"` - - // digitalocean - Digitalocean *RequestSecretValueDigitalOcean `json:"digitalocean,omitempty"` - - // gcp - Gcp *RequestSecretValueGcp `json:"gcp,omitempty"` - - // hetzner - Hetzner *RequestSecretValueHetzner `json:"hetzner,omitempty"` - - // password - Password *RequestSecretValuePassword `json:"password,omitempty"` - - // ssh key - SSHKey *RequestSecretValueSSHKey `json:"ssh_key,omitempty"` -} - -// Validate validates this request secret value -func (m *RequestSecretValue) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAws(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAzure(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDigitalocean(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGcp(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHetzner(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSSHKey(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestSecretValue) validateAws(formats strfmt.Registry) error { - if swag.IsZero(m.Aws) { // not required - return nil - } - - if m.Aws != nil { - if err := m.Aws.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("aws") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("aws") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) validateAzure(formats strfmt.Registry) error { - if swag.IsZero(m.Azure) { // not required - return nil - } - - if m.Azure != nil { - if err := m.Azure.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("azure") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("azure") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) validateDigitalocean(formats strfmt.Registry) error { - if swag.IsZero(m.Digitalocean) { // not required - return nil - } - - if m.Digitalocean != nil { - if err := m.Digitalocean.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("digitalocean") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("digitalocean") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) validateGcp(formats strfmt.Registry) error { - if swag.IsZero(m.Gcp) { // not required - return nil - } - - if m.Gcp != nil { - if err := m.Gcp.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gcp") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gcp") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) validateHetzner(formats strfmt.Registry) error { - if swag.IsZero(m.Hetzner) { // not required - return nil - } - - if m.Hetzner != nil { - if err := m.Hetzner.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hetzner") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hetzner") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) validatePassword(formats strfmt.Registry) error { - if swag.IsZero(m.Password) { // not required - return nil - } - - if m.Password != nil { - if err := m.Password.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) validateSSHKey(formats strfmt.Registry) error { - if swag.IsZero(m.SSHKey) { // not required - return nil - } - - if m.SSHKey != nil { - if err := m.SSHKey.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ssh_key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ssh_key") - } - return err - } - } - - return nil -} - -// ContextValidate validate this request secret value based on the context it is used -func (m *RequestSecretValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAws(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAzure(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDigitalocean(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGcp(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHetzner(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePassword(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSSHKey(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestSecretValue) contextValidateAws(ctx context.Context, formats strfmt.Registry) error { - - if m.Aws != nil { - if err := m.Aws.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("aws") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("aws") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error { - - if m.Azure != nil { - if err := m.Azure.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("azure") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("azure") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) contextValidateDigitalocean(ctx context.Context, formats strfmt.Registry) error { - - if m.Digitalocean != nil { - if err := m.Digitalocean.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("digitalocean") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("digitalocean") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) contextValidateGcp(ctx context.Context, formats strfmt.Registry) error { - - if m.Gcp != nil { - if err := m.Gcp.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gcp") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gcp") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) contextValidateHetzner(ctx context.Context, formats strfmt.Registry) error { - - if m.Hetzner != nil { - if err := m.Hetzner.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hetzner") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hetzner") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) contextValidatePassword(ctx context.Context, formats strfmt.Registry) error { - - if m.Password != nil { - if err := m.Password.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - } - - return nil -} - -func (m *RequestSecretValue) contextValidateSSHKey(ctx context.Context, formats strfmt.Registry) error { - - if m.SSHKey != nil { - if err := m.SSHKey.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ssh_key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ssh_key") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValue) UnmarshalBinary(b []byte) error { - var res RequestSecretValue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_aws.go b/console/service/models/request_secret_value_aws.go deleted file mode 100644 index 209d2e969..000000000 --- a/console/service/models/request_secret_value_aws.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValueAws request secret value aws -// -// swagger:model Request.SecretValue.Aws -type RequestSecretValueAws struct { - - // a w s a c c e s s k e y ID - AWSACCESSKEYID string `json:"AWS_ACCESS_KEY_ID,omitempty"` - - // a w s s e c r e t a c c e s s k e y - AWSSECRETACCESSKEY string `json:"AWS_SECRET_ACCESS_KEY,omitempty"` -} - -// Validate validates this request secret value aws -func (m *RequestSecretValueAws) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value aws based on context it is used -func (m *RequestSecretValueAws) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValueAws) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValueAws) UnmarshalBinary(b []byte) error { - var res RequestSecretValueAws - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_azure.go b/console/service/models/request_secret_value_azure.go deleted file mode 100644 index 94e5feacc..000000000 --- a/console/service/models/request_secret_value_azure.go +++ /dev/null @@ -1,59 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValueAzure request secret value azure -// -// swagger:model Request.SecretValue.Azure -type RequestSecretValueAzure struct { - - // a z u r e c l i e n t ID - AZURECLIENTID string `json:"AZURE_CLIENT_ID,omitempty"` - - // a z u r e s e c r e t - AZURESECRET string `json:"AZURE_SECRET,omitempty"` - - // a z u r e s u b s c r IP t i o n ID - AZURESUBSCRIPTIONID string `json:"AZURE_SUBSCRIPTION_ID,omitempty"` - - // a z u r e t e n a n t - AZURETENANT string `json:"AZURE_TENANT,omitempty"` -} - -// Validate validates this request secret value azure -func (m *RequestSecretValueAzure) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value azure based on context it is used -func (m *RequestSecretValueAzure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValueAzure) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValueAzure) UnmarshalBinary(b []byte) error { - var res RequestSecretValueAzure - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_digital_ocean.go b/console/service/models/request_secret_value_digital_ocean.go deleted file mode 100644 index 0588914d9..000000000 --- a/console/service/models/request_secret_value_digital_ocean.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValueDigitalOcean request secret value digital ocean -// -// swagger:model Request.SecretValue.DigitalOcean -type RequestSecretValueDigitalOcean struct { - - // d o API t o k e n - DOAPITOKEN string `json:"DO_API_TOKEN,omitempty"` -} - -// Validate validates this request secret value digital ocean -func (m *RequestSecretValueDigitalOcean) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value digital ocean based on context it is used -func (m *RequestSecretValueDigitalOcean) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValueDigitalOcean) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValueDigitalOcean) UnmarshalBinary(b []byte) error { - var res RequestSecretValueDigitalOcean - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_gcp.go b/console/service/models/request_secret_value_gcp.go deleted file mode 100644 index c40c329ea..000000000 --- a/console/service/models/request_secret_value_gcp.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValueGcp request secret value gcp -// -// swagger:model Request.SecretValue.Gcp -type RequestSecretValueGcp struct { - - // g c p s e r v i c e a c c o u n t c o n t e n t s - GCPSERVICEACCOUNTCONTENTS string `json:"GCP_SERVICE_ACCOUNT_CONTENTS,omitempty"` -} - -// Validate validates this request secret value gcp -func (m *RequestSecretValueGcp) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value gcp based on context it is used -func (m *RequestSecretValueGcp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValueGcp) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValueGcp) UnmarshalBinary(b []byte) error { - var res RequestSecretValueGcp - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_hetzner.go b/console/service/models/request_secret_value_hetzner.go deleted file mode 100644 index 1b21d7822..000000000 --- a/console/service/models/request_secret_value_hetzner.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValueHetzner request secret value hetzner -// -// swagger:model Request.SecretValue.Hetzner -type RequestSecretValueHetzner struct { - - // h c l o u d API t o k e n - HCLOUDAPITOKEN string `json:"HCLOUD_API_TOKEN,omitempty"` -} - -// Validate validates this request secret value hetzner -func (m *RequestSecretValueHetzner) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value hetzner based on context it is used -func (m *RequestSecretValueHetzner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValueHetzner) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValueHetzner) UnmarshalBinary(b []byte) error { - var res RequestSecretValueHetzner - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_password.go b/console/service/models/request_secret_value_password.go deleted file mode 100644 index 0d002433a..000000000 --- a/console/service/models/request_secret_value_password.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValuePassword request secret value password -// -// swagger:model Request.SecretValue.Password -type RequestSecretValuePassword struct { - - // p a s s w o r d - PASSWORD string `json:"PASSWORD,omitempty"` - - // u s e r n a m e - USERNAME string `json:"USERNAME,omitempty"` -} - -// Validate validates this request secret value password -func (m *RequestSecretValuePassword) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value password based on context it is used -func (m *RequestSecretValuePassword) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValuePassword) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValuePassword) UnmarshalBinary(b []byte) error { - var res RequestSecretValuePassword - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/request_secret_value_ssh_key.go b/console/service/models/request_secret_value_ssh_key.go deleted file mode 100644 index 627866742..000000000 --- a/console/service/models/request_secret_value_ssh_key.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RequestSecretValueSSHKey request secret value Ssh key -// -// swagger:model Request.SecretValue.SshKey -type RequestSecretValueSSHKey struct { - - // SSH p r i v a t e k e y - SSHPRIVATEKEY string `json:"SSH_PRIVATE_KEY,omitempty"` -} - -// Validate validates this request secret value Ssh key -func (m *RequestSecretValueSSHKey) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this request secret value Ssh key based on context it is used -func (m *RequestSecretValueSSHKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestSecretValueSSHKey) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestSecretValueSSHKey) UnmarshalBinary(b []byte) error { - var res RequestSecretValueSSHKey - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_cluster_create.go b/console/service/models/response_cluster_create.go deleted file mode 100644 index d7e282ab1..000000000 --- a/console/service/models/response_cluster_create.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseClusterCreate Response struct for cluster creation -// -// swagger:model Response.ClusterCreate -type ResponseClusterCreate struct { - - // unique code for cluster - ClusterID int64 `json:"cluster_id,omitempty"` - - // operation id - OperationID int64 `json:"operation_id,omitempty"` -} - -// Validate validates this response cluster create -func (m *ResponseClusterCreate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response cluster create based on context it is used -func (m *ResponseClusterCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseClusterCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseClusterCreate) UnmarshalBinary(b []byte) error { - var res ResponseClusterCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_cluster_default_name.go b/console/service/models/response_cluster_default_name.go deleted file mode 100644 index de0a96cb4..000000000 --- a/console/service/models/response_cluster_default_name.go +++ /dev/null @@ -1,51 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseClusterDefaultName Response struct for cluster default name -// -// swagger:model Response.ClusterDefaultName -type ResponseClusterDefaultName struct { - - // name - // Example: postgres-cluster-01 - Name string `json:"name,omitempty"` -} - -// Validate validates this response cluster default name -func (m *ResponseClusterDefaultName) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response cluster default name based on context it is used -func (m *ResponseClusterDefaultName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseClusterDefaultName) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseClusterDefaultName) UnmarshalBinary(b []byte) error { - var res ResponseClusterDefaultName - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_cluster_logs.go b/console/service/models/response_cluster_logs.go deleted file mode 100644 index f70dfcb3e..000000000 --- a/console/service/models/response_cluster_logs.go +++ /dev/null @@ -1,50 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseClusterLogs Logs for cluster -// -// swagger:model Response.ClusterLogs -type ResponseClusterLogs struct { - - // all available logs - Logs string `json:"logs,omitempty"` -} - -// Validate validates this response cluster logs -func (m *ResponseClusterLogs) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response cluster logs based on context it is used -func (m *ResponseClusterLogs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseClusterLogs) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseClusterLogs) UnmarshalBinary(b []byte) error { - var res ResponseClusterLogs - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_clusters_info.go b/console/service/models/response_clusters_info.go deleted file mode 100644 index d8a763acf..000000000 --- a/console/service/models/response_clusters_info.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseClustersInfo response clusters info -// -// swagger:model Response.ClustersInfo -type ResponseClustersInfo struct { - - // data - Data []*ClusterInfo `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response clusters info -func (m *ResponseClustersInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseClustersInfo) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseClustersInfo) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response clusters info based on the context it is used -func (m *ResponseClustersInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseClustersInfo) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseClustersInfo) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseClustersInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseClustersInfo) UnmarshalBinary(b []byte) error { - var res ResponseClustersInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_database_extension.go b/console/service/models/response_database_extension.go deleted file mode 100644 index afc392c8d..000000000 --- a/console/service/models/response_database_extension.go +++ /dev/null @@ -1,75 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseDatabaseExtension Info about database extension -// -// swagger:model Response.DatabaseExtension -type ResponseDatabaseExtension struct { - - // contrib - // Example: false - Contrib bool `json:"contrib,omitempty"` - - // description - // Example: Citus is PostgreSQL extension that transforms... - Description *string `json:"description,omitempty"` - - // image - // Example: citus.png - Image *string `json:"image,omitempty"` - - // name - // Example: Citus - Name string `json:"name,omitempty"` - - // postgres max version - // Example: 16 - PostgresMaxVersion *string `json:"postgres_max_version,omitempty"` - - // postgres min version - // Example: 11 - PostgresMinVersion *string `json:"postgres_min_version,omitempty"` - - // url - // Example: https://github.com/citusdata/citus - URL *string `json:"url,omitempty"` -} - -// Validate validates this response database extension -func (m *ResponseDatabaseExtension) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response database extension based on context it is used -func (m *ResponseDatabaseExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseDatabaseExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseDatabaseExtension) UnmarshalBinary(b []byte) error { - var res ResponseDatabaseExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_database_extensions.go b/console/service/models/response_database_extensions.go deleted file mode 100644 index bc219171c..000000000 --- a/console/service/models/response_database_extensions.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseDatabaseExtensions response database extensions -// -// swagger:model Response.DatabaseExtensions -type ResponseDatabaseExtensions struct { - - // data - Data []*ResponseDatabaseExtension `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response database extensions -func (m *ResponseDatabaseExtensions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDatabaseExtensions) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDatabaseExtensions) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response database extensions based on the context it is used -func (m *ResponseDatabaseExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDatabaseExtensions) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDatabaseExtensions) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseDatabaseExtensions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseDatabaseExtensions) UnmarshalBinary(b []byte) error { - var res ResponseDatabaseExtensions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_deployment_info.go b/console/service/models/response_deployment_info.go deleted file mode 100644 index 50aea3694..000000000 --- a/console/service/models/response_deployment_info.go +++ /dev/null @@ -1,507 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseDeploymentInfo Deployment info -// -// swagger:model Response.DeploymentInfo -type ResponseDeploymentInfo struct { - - // avatar url - AvatarURL string `json:"avatar_url,omitempty"` - - // List of available regions for current deployment - CloudRegions []*DeploymentInfoCloudRegion `json:"cloud_regions"` - - // code - // Example: aws - Code string `json:"code,omitempty"` - - // description - // Example: Amazon web services - Description string `json:"description,omitempty"` - - // instance types - InstanceTypes *ResponseDeploymentInfoInstanceTypes `json:"instance_types,omitempty"` - - // Hardware disks info - Volumes []*ResponseDeploymentInfoVolumesItems0 `json:"volumes"` -} - -// Validate validates this response deployment info -func (m *ResponseDeploymentInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloudRegions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstanceTypes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVolumes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDeploymentInfo) validateCloudRegions(formats strfmt.Registry) error { - if swag.IsZero(m.CloudRegions) { // not required - return nil - } - - for i := 0; i < len(m.CloudRegions); i++ { - if swag.IsZero(m.CloudRegions[i]) { // not required - continue - } - - if m.CloudRegions[i] != nil { - if err := m.CloudRegions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloud_regions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloud_regions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentInfo) validateInstanceTypes(formats strfmt.Registry) error { - if swag.IsZero(m.InstanceTypes) { // not required - return nil - } - - if m.InstanceTypes != nil { - if err := m.InstanceTypes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types") - } - return err - } - } - - return nil -} - -func (m *ResponseDeploymentInfo) validateVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.Volumes) { // not required - return nil - } - - for i := 0; i < len(m.Volumes); i++ { - if swag.IsZero(m.Volumes[i]) { // not required - continue - } - - if m.Volumes[i] != nil { - if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this response deployment info based on the context it is used -func (m *ResponseDeploymentInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCloudRegions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateInstanceTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVolumes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDeploymentInfo) contextValidateCloudRegions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CloudRegions); i++ { - - if m.CloudRegions[i] != nil { - if err := m.CloudRegions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cloud_regions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cloud_regions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentInfo) contextValidateInstanceTypes(ctx context.Context, formats strfmt.Registry) error { - - if m.InstanceTypes != nil { - if err := m.InstanceTypes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types") - } - return err - } - } - - return nil -} - -func (m *ResponseDeploymentInfo) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Volumes); i++ { - - if m.Volumes[i] != nil { - if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseDeploymentInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseDeploymentInfo) UnmarshalBinary(b []byte) error { - var res ResponseDeploymentInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ResponseDeploymentInfoInstanceTypes Lists of available instance types -// -// swagger:model ResponseDeploymentInfoInstanceTypes -type ResponseDeploymentInfoInstanceTypes struct { - - // large - Large []*DeploymentInstanceType `json:"large"` - - // medium - Medium []*DeploymentInstanceType `json:"medium"` - - // small - Small []*DeploymentInstanceType `json:"small"` -} - -// Validate validates this response deployment info instance types -func (m *ResponseDeploymentInfoInstanceTypes) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLarge(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMedium(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmall(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDeploymentInfoInstanceTypes) validateLarge(formats strfmt.Registry) error { - if swag.IsZero(m.Large) { // not required - return nil - } - - for i := 0; i < len(m.Large); i++ { - if swag.IsZero(m.Large[i]) { // not required - continue - } - - if m.Large[i] != nil { - if err := m.Large[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types" + "." + "large" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types" + "." + "large" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentInfoInstanceTypes) validateMedium(formats strfmt.Registry) error { - if swag.IsZero(m.Medium) { // not required - return nil - } - - for i := 0; i < len(m.Medium); i++ { - if swag.IsZero(m.Medium[i]) { // not required - continue - } - - if m.Medium[i] != nil { - if err := m.Medium[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types" + "." + "medium" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types" + "." + "medium" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentInfoInstanceTypes) validateSmall(formats strfmt.Registry) error { - if swag.IsZero(m.Small) { // not required - return nil - } - - for i := 0; i < len(m.Small); i++ { - if swag.IsZero(m.Small[i]) { // not required - continue - } - - if m.Small[i] != nil { - if err := m.Small[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types" + "." + "small" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types" + "." + "small" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this response deployment info instance types based on the context it is used -func (m *ResponseDeploymentInfoInstanceTypes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLarge(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMedium(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSmall(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDeploymentInfoInstanceTypes) contextValidateLarge(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Large); i++ { - - if m.Large[i] != nil { - if err := m.Large[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types" + "." + "large" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types" + "." + "large" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentInfoInstanceTypes) contextValidateMedium(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Medium); i++ { - - if m.Medium[i] != nil { - if err := m.Medium[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types" + "." + "medium" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types" + "." + "medium" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentInfoInstanceTypes) contextValidateSmall(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Small); i++ { - - if m.Small[i] != nil { - if err := m.Small[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("instance_types" + "." + "small" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("instance_types" + "." + "small" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseDeploymentInfoInstanceTypes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseDeploymentInfoInstanceTypes) UnmarshalBinary(b []byte) error { - var res ResponseDeploymentInfoInstanceTypes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ResponseDeploymentInfoVolumesItems0 response deployment info volumes items0 -// -// swagger:model ResponseDeploymentInfoVolumesItems0 -type ResponseDeploymentInfoVolumesItems0 struct { - - // Price currency - // Example: $ - Currency string `json:"currency,omitempty"` - - // Default volume - // Example: false - IsDefault *bool `json:"is_default,omitempty"` - - // Sets in GB - // Example: 256 - MaxSize int64 `json:"max_size,omitempty"` - - // Sets in GB - // Example: 10 - MinSize int64 `json:"min_size,omitempty"` - - // Price for disk by months - // Example: 0.1 - PriceMonthly float64 `json:"price_monthly,omitempty"` - - // Volume description - // Example: General purpose SSD disk - VolumeDescription string `json:"volume_description,omitempty"` - - // Volume type - // Example: gp3 - VolumeType string `json:"volume_type,omitempty"` -} - -// Validate validates this response deployment info volumes items0 -func (m *ResponseDeploymentInfoVolumesItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response deployment info volumes items0 based on context it is used -func (m *ResponseDeploymentInfoVolumesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseDeploymentInfoVolumesItems0) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseDeploymentInfoVolumesItems0) UnmarshalBinary(b []byte) error { - var res ResponseDeploymentInfoVolumesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_deployments_info.go b/console/service/models/response_deployments_info.go deleted file mode 100644 index a15324281..000000000 --- a/console/service/models/response_deployments_info.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseDeploymentsInfo Deployments info -// -// swagger:model Response.DeploymentsInfo -type ResponseDeploymentsInfo struct { - - // data - Data []*ResponseDeploymentInfo `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response deployments info -func (m *ResponseDeploymentsInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDeploymentsInfo) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentsInfo) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response deployments info based on the context it is used -func (m *ResponseDeploymentsInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseDeploymentsInfo) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseDeploymentsInfo) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseDeploymentsInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseDeploymentsInfo) UnmarshalBinary(b []byte) error { - var res ResponseDeploymentsInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_environment.go b/console/service/models/response_environment.go deleted file mode 100644 index f6f1e608f..000000000 --- a/console/service/models/response_environment.go +++ /dev/null @@ -1,108 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ResponseEnvironment response environment -// -// swagger:model Response.Environment -type ResponseEnvironment struct { - - // created at - // Example: 16.10.2023T11:20:00Z - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // description - // Example: environment for production - Description *string `json:"description,omitempty"` - - // id - // Example: 1 - ID int64 `json:"id,omitempty"` - - // name - // Example: production - Name string `json:"name,omitempty"` - - // updated at - // Example: 16.10.2023T11:20:00Z - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at,omitempty"` -} - -// Validate validates this response environment -func (m *ResponseEnvironment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseEnvironment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ResponseEnvironment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this response environment based on context it is used -func (m *ResponseEnvironment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseEnvironment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseEnvironment) UnmarshalBinary(b []byte) error { - var res ResponseEnvironment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_environments_list.go b/console/service/models/response_environments_list.go deleted file mode 100644 index 534e55e8a..000000000 --- a/console/service/models/response_environments_list.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseEnvironmentsList response environments list -// -// swagger:model Response.EnvironmentsList -type ResponseEnvironmentsList struct { - - // data - Data []*ResponseEnvironment `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response environments list -func (m *ResponseEnvironmentsList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseEnvironmentsList) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseEnvironmentsList) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response environments list based on the context it is used -func (m *ResponseEnvironmentsList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseEnvironmentsList) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseEnvironmentsList) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseEnvironmentsList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseEnvironmentsList) UnmarshalBinary(b []byte) error { - var res ResponseEnvironmentsList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_error.go b/console/service/models/response_error.go deleted file mode 100644 index 889da4426..000000000 --- a/console/service/models/response_error.go +++ /dev/null @@ -1,56 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseError Error object -// -// swagger:model Response.Error -type ResponseError struct { - - // code - Code int64 `json:"code,omitempty"` - - // description - Description string `json:"description,omitempty"` - - // title - Title string `json:"title,omitempty"` -} - -// Validate validates this response error -func (m *ResponseError) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response error based on context it is used -func (m *ResponseError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseError) UnmarshalBinary(b []byte) error { - var res ResponseError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_operation.go b/console/service/models/response_operation.go deleted file mode 100644 index 891183da6..000000000 --- a/console/service/models/response_operation.go +++ /dev/null @@ -1,116 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ResponseOperation response operation -// -// swagger:model Response.Operation -type ResponseOperation struct { - - // cluster name - // Example: drm-prod-cluster - ClusterName string `json:"cluster_name,omitempty"` - - // environment - // Example: production - Environment string `json:"environment,omitempty"` - - // finished - // Example: 16.10.2023T11:20:00Z - // Format: date-time - Finished *strfmt.DateTime `json:"finished,omitempty"` - - // id - // Example: 1 - ID int64 `json:"id,omitempty"` - - // started - // Example: 16.10.2023T11:20:00Z - // Format: date-time - Started strfmt.DateTime `json:"started,omitempty"` - - // status - // Example: success - Status string `json:"status,omitempty"` - - // type - // Example: deploy - Type string `json:"type,omitempty"` -} - -// Validate validates this response operation -func (m *ResponseOperation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFinished(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStarted(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseOperation) validateFinished(formats strfmt.Registry) error { - if swag.IsZero(m.Finished) { // not required - return nil - } - - if err := validate.FormatOf("finished", "body", "date-time", m.Finished.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ResponseOperation) validateStarted(formats strfmt.Registry) error { - if swag.IsZero(m.Started) { // not required - return nil - } - - if err := validate.FormatOf("started", "body", "date-time", m.Started.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this response operation based on context it is used -func (m *ResponseOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseOperation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseOperation) UnmarshalBinary(b []byte) error { - var res ResponseOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_operations_list.go b/console/service/models/response_operations_list.go deleted file mode 100644 index 22c0a6d78..000000000 --- a/console/service/models/response_operations_list.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseOperationsList response operations list -// -// swagger:model Response.OperationsList -type ResponseOperationsList struct { - - // data - Data []*ResponseOperation `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response operations list -func (m *ResponseOperationsList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseOperationsList) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseOperationsList) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response operations list based on the context it is used -func (m *ResponseOperationsList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseOperationsList) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseOperationsList) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseOperationsList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseOperationsList) UnmarshalBinary(b []byte) error { - var res ResponseOperationsList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_postgres_version.go b/console/service/models/response_postgres_version.go deleted file mode 100644 index b899231f3..000000000 --- a/console/service/models/response_postgres_version.go +++ /dev/null @@ -1,100 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ResponsePostgresVersion response postgres version -// -// swagger:model Response.PostgresVersion -type ResponsePostgresVersion struct { - - // end of life - // Example: 2022-11-10 - // Format: date - EndOfLife strfmt.Date `json:"end_of_life,omitempty"` - - // major version - // Example: 10 - MajorVersion int64 `json:"major_version,omitempty"` - - // release date - // Example: 2017-10-05 - // Format: date - ReleaseDate strfmt.Date `json:"release_date,omitempty"` -} - -// Validate validates this response postgres version -func (m *ResponsePostgresVersion) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEndOfLife(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReleaseDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponsePostgresVersion) validateEndOfLife(formats strfmt.Registry) error { - if swag.IsZero(m.EndOfLife) { // not required - return nil - } - - if err := validate.FormatOf("end_of_life", "body", "date", m.EndOfLife.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ResponsePostgresVersion) validateReleaseDate(formats strfmt.Registry) error { - if swag.IsZero(m.ReleaseDate) { // not required - return nil - } - - if err := validate.FormatOf("release_date", "body", "date", m.ReleaseDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this response postgres version based on context it is used -func (m *ResponsePostgresVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponsePostgresVersion) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponsePostgresVersion) UnmarshalBinary(b []byte) error { - var res ResponsePostgresVersion - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_postgres_versions.go b/console/service/models/response_postgres_versions.go deleted file mode 100644 index 05d70dea8..000000000 --- a/console/service/models/response_postgres_versions.go +++ /dev/null @@ -1,116 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponsePostgresVersions response postgres versions -// -// swagger:model Response.PostgresVersions -type ResponsePostgresVersions struct { - - // data - Data []*ResponsePostgresVersion `json:"data"` -} - -// Validate validates this response postgres versions -func (m *ResponsePostgresVersions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponsePostgresVersions) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this response postgres versions based on the context it is used -func (m *ResponsePostgresVersions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponsePostgresVersions) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponsePostgresVersions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponsePostgresVersions) UnmarshalBinary(b []byte) error { - var res ResponsePostgresVersions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_project.go b/console/service/models/response_project.go deleted file mode 100644 index d26fb373e..000000000 --- a/console/service/models/response_project.go +++ /dev/null @@ -1,105 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ResponseProject response project -// -// swagger:model Response.Project -type ResponseProject struct { - - // created at - // Example: 16.10.2023T11:20:00Z - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // description - Description *string `json:"description,omitempty"` - - // id - ID int64 `json:"id,omitempty"` - - // name - Name string `json:"name,omitempty"` - - // updated at - // Example: 16.10.2023T11:20:00Z - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at,omitempty"` -} - -// Validate validates this response project -func (m *ResponseProject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseProject) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ResponseProject) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this response project based on context it is used -func (m *ResponseProject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseProject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseProject) UnmarshalBinary(b []byte) error { - var res ResponseProject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_projects_list.go b/console/service/models/response_projects_list.go deleted file mode 100644 index 3d7bbe286..000000000 --- a/console/service/models/response_projects_list.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseProjectsList response projects list -// -// swagger:model Response.ProjectsList -type ResponseProjectsList struct { - - // data - Data []*ResponseProject `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response projects list -func (m *ResponseProjectsList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseProjectsList) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseProjectsList) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response projects list based on the context it is used -func (m *ResponseProjectsList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseProjectsList) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseProjectsList) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseProjectsList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseProjectsList) UnmarshalBinary(b []byte) error { - var res ResponseProjectsList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_secret_info.go b/console/service/models/response_secret_info.go deleted file mode 100644 index 9d32c66f7..000000000 --- a/console/service/models/response_secret_info.go +++ /dev/null @@ -1,163 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ResponseSecretInfo response secret info -// -// swagger:model Response.SecretInfo -type ResponseSecretInfo struct { - - // created at - // Example: 16.10.2023T11:20:00Z - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // id - // Example: 1 - ID int64 `json:"id,omitempty"` - - // is used - // Example: true - IsUsed bool `json:"is_used,omitempty"` - - // name - // Example: aws key - Name string `json:"name,omitempty"` - - // project id - // Example: 1 - ProjectID int64 `json:"project_id,omitempty"` - - // type - Type SecretType `json:"type,omitempty"` - - // updated at - // Example: 16.10.2023T11:20:00Z - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at,omitempty"` - - // used by clusters - // Example: mds-prod, drm-prod - UsedByClusters *string `json:"used_by_clusters,omitempty"` -} - -// Validate validates this response secret info -func (m *ResponseSecretInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSecretInfo) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ResponseSecretInfo) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -func (m *ResponseSecretInfo) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this response secret info based on the context it is used -func (m *ResponseSecretInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSecretInfo) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseSecretInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseSecretInfo) UnmarshalBinary(b []byte) error { - var res ResponseSecretInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_secret_info_list.go b/console/service/models/response_secret_info_list.go deleted file mode 100644 index cb76291f8..000000000 --- a/console/service/models/response_secret_info_list.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseSecretInfoList response secret info list -// -// swagger:model Response.SecretInfoList -type ResponseSecretInfoList struct { - - // data - Data []*ResponseSecretInfo `json:"data"` - - // meta - Meta *MetaPagination `json:"meta,omitempty"` -} - -// Validate validates this response secret info list -func (m *ResponseSecretInfoList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSecretInfoList) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseSecretInfoList) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response secret info list based on the context it is used -func (m *ResponseSecretInfoList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSecretInfoList) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseSecretInfoList) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseSecretInfoList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseSecretInfoList) UnmarshalBinary(b []byte) error { - var res ResponseSecretInfoList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_setting.go b/console/service/models/response_setting.go deleted file mode 100644 index 4fa199e87..000000000 --- a/console/service/models/response_setting.go +++ /dev/null @@ -1,103 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ResponseSetting Setting -// -// swagger:model Response.Setting -type ResponseSetting struct { - - // created at - // Format: datetime - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // id - ID int64 `json:"id,omitempty"` - - // name - Name string `json:"name,omitempty"` - - // updated at - // Format: datetime - UpdatedAt *strfmt.DateTime `json:"updated_at,omitempty"` - - // value - Value interface{} `json:"value,omitempty"` -} - -// Validate validates this response setting -func (m *ResponseSetting) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSetting) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "datetime", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ResponseSetting) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "datetime", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this response setting based on context it is used -func (m *ResponseSetting) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseSetting) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseSetting) UnmarshalBinary(b []byte) error { - var res ResponseSetting - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_settings.go b/console/service/models/response_settings.go deleted file mode 100644 index e9eaf2d60..000000000 --- a/console/service/models/response_settings.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseSettings List of settings -// -// swagger:model Response.Settings -type ResponseSettings struct { - - // data - Data []*ResponseSetting `json:"data"` - - // mete - Mete *MetaPagination `json:"mete,omitempty"` -} - -// Validate validates this response settings -func (m *ResponseSettings) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMete(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSettings) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - for i := 0; i < len(m.Data); i++ { - if swag.IsZero(m.Data[i]) { // not required - continue - } - - if m.Data[i] != nil { - if err := m.Data[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseSettings) validateMete(formats strfmt.Registry) error { - if swag.IsZero(m.Mete) { // not required - return nil - } - - if m.Mete != nil { - if err := m.Mete.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mete") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mete") - } - return err - } - } - - return nil -} - -// ContextValidate validate this response settings based on the context it is used -func (m *ResponseSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMete(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResponseSettings) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data); i++ { - - if m.Data[i] != nil { - if err := m.Data[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ResponseSettings) contextValidateMete(ctx context.Context, formats strfmt.Registry) error { - - if m.Mete != nil { - if err := m.Mete.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mete") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mete") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseSettings) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseSettings) UnmarshalBinary(b []byte) error { - var res ResponseSettings - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/response_version.go b/console/service/models/response_version.go deleted file mode 100644 index 3b8015716..000000000 --- a/console/service/models/response_version.go +++ /dev/null @@ -1,51 +0,0 @@ -// 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 ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResponseVersion Version response -// -// swagger:model Response.Version -type ResponseVersion struct { - - // version - // Example: v1.0.0 - Version string `json:"version,omitempty"` -} - -// Validate validates this response version -func (m *ResponseVersion) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this response version based on context it is used -func (m *ResponseVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResponseVersion) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResponseVersion) UnmarshalBinary(b []byte) error { - var res ResponseVersion - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/console/service/models/secret_type.go b/console/service/models/secret_type.go deleted file mode 100644 index 0152925cb..000000000 --- a/console/service/models/secret_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// 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 ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SecretType secret type -// -// swagger:model Secret.Type -type SecretType string - -func NewSecretType(value SecretType) *SecretType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SecretType. -func (m SecretType) Pointer() *SecretType { - return &m -} - -const ( - - // SecretTypeAws captures enum value "aws" - SecretTypeAws SecretType = "aws" - - // SecretTypeGcp captures enum value "gcp" - SecretTypeGcp SecretType = "gcp" - - // SecretTypeHetzner captures enum value "hetzner" - SecretTypeHetzner SecretType = "hetzner" - - // SecretTypeSSHKey captures enum value "ssh_key" - SecretTypeSSHKey SecretType = "ssh_key" - - // SecretTypeDigitalocean captures enum value "digitalocean" - SecretTypeDigitalocean SecretType = "digitalocean" - - // SecretTypePassword captures enum value "password" - SecretTypePassword SecretType = "password" - - // SecretTypeAzure captures enum value "azure" - SecretTypeAzure SecretType = "azure" -) - -// for schema -var secretTypeEnum []interface{} - -func init() { - var res []SecretType - if err := json.Unmarshal([]byte(`["aws","gcp","hetzner","ssh_key","digitalocean","password","azure"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - secretTypeEnum = append(secretTypeEnum, v) - } -} - -func (m SecretType) validateSecretTypeEnum(path, location string, value SecretType) error { - if err := validate.EnumCase(path, location, value, secretTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this secret type -func (m SecretType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSecretTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this secret type based on context it is used -func (m SecretType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/console/service/restapi/doc.go b/console/service/restapi/doc.go deleted file mode 100644 index bdea8ec17..000000000 --- a/console/service/restapi/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package restapi PG Console -// -// API for PG Console WEB -// Schemes: -// http -// Host: localhost:8080 -// BasePath: /api/v1 -// Version: 1.0.0 -// -// Consumes: -// - application/json -// - plain/text -// -// Produces: -// - application/json -// -// swagger:meta -package restapi diff --git a/console/service/restapi/embedded_spec.go b/console/service/restapi/embedded_spec.go deleted file mode 100644 index bbd95aa41..000000000 --- a/console/service/restapi/embedded_spec.go +++ /dev/null @@ -1,4563 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restapi - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "API for PG Console WEB", - "title": "PG Console", - "version": "1.0.0" - }, - "host": "localhost:8080", - "basePath": "/api/v1", - "paths": { - "/clusters": { - "get": { - "tags": [ - "cluster" - ], - "summary": "Get info about clusters", - "parameters": [ - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "project_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - }, - { - "type": "string", - "description": "Filter by status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "Filter by location", - "name": "location", - "in": "query" - }, - { - "type": "string", - "description": "Filter by environment", - "name": "environment", - "in": "query" - }, - { - "type": "integer", - "description": "Filter by server_count", - "name": "server_count", - "in": "query" - }, - { - "type": "integer", - "description": "Filter by postgres_version", - "name": "postgres_version", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Created at after this date", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Created at till this date", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Sort by fields. Example: sort_by=id,-name,created_at,updated_at\n Supported values:\n - id\n - name\n - created_at\n - updated_at\n - environment\n - project\n - status\n - location\n - server_count\n - postgres_version\n", - "name": "sort_by", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClustersInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "cluster" - ], - "summary": "Create new cluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterCreate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/default_name": { - "get": { - "tags": [ - "cluster" - ], - "summary": "Get cluster default name", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterDefaultName" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}": { - "get": { - "tags": [ - "cluster" - ], - "summary": "Get cluster info", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ClusterInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "delete": { - "tags": [ - "cluster" - ], - "summary": "Delete cluster", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/refresh": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Refresh cluster info", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ClusterInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/reinit": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Reinit cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterReinit" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/reload": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Reload cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterReload" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/remove": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Remove cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterRemove" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/restart": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Restart cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterRestart" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/start": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Start cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterStart" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/stop": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Stop cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterStop" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/database/extensions": { - "get": { - "tags": [ - "dictionary" - ], - "summary": "Info about available database extensions", - "parameters": [ - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "enum": [ - "all", - "contrib", - "third_party" - ], - "type": "string", - "default": "all", - "name": "extension_type", - "in": "query" - }, - { - "type": "string", - "name": "postgres_version", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.DatabaseExtensions" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/environments": { - "get": { - "tags": [ - "environment" - ], - "summary": "Get environemtns list", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.EnvironmentsList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "environment" - ], - "summary": "Create environemtn", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.Environment" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Environment" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/environments/{id}": { - "delete": { - "tags": [ - "environment" - ], - "summary": "Delete environment", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/external/deployments": { - "get": { - "tags": [ - "dictionary" - ], - "summary": "Get full info about available external deployments", - "parameters": [ - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.DeploymentsInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/operations": { - "get": { - "tags": [ - "operation" - ], - "summary": "Get operations list for current project", - "parameters": [ - { - "type": "integer", - "description": "Required parameter for filter", - "name": "project_id", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Operations started after this date", - "name": "start_date", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Operations started till this date", - "name": "end_date", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Filter by cluster_name", - "name": "cluster_name", - "in": "query" - }, - { - "type": "string", - "description": "Filter by type", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "Filter by status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "Filter by environment", - "name": "environment", - "in": "query" - }, - { - "type": "string", - "description": "Sort by fields. Example: sort_by=cluster_name,-type,status,id,created_at,updated_at\n Supported valuese:\n - id\n - cluster_name\n - type\n - status\n - started_at\n - updated_at\n - cluster\n - environment\n", - "name": "sort_by", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.OperationsList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/operations/{id}/log": { - "get": { - "consumes": [ - "plain/text" - ], - "tags": [ - "operation" - ], - "summary": "Get operation log by operation_id", - "parameters": [ - { - "type": "integer", - "description": "Operation id", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - }, - "headers": { - "content-type": { - "type": "string" - }, - "x-log-completed": { - "type": "boolean" - } - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/postgres_versions": { - "get": { - "tags": [ - "dictionary" - ], - "summary": "Get supported postgres versions", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.PostgresVersions" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/projects": { - "get": { - "tags": [ - "project" - ], - "summary": "Get projects list", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ProjectsList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "project" - ], - "summary": "Create new project", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ProjectCreate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Project" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/projects/{id}": { - "delete": { - "tags": [ - "project" - ], - "summary": "Delete project", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "patch": { - "tags": [ - "project" - ], - "summary": "Change project", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ProjectPatch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Project" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/secrets": { - "get": { - "tags": [ - "secret" - ], - "summary": "Get secrets list", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "project_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - }, - { - "type": "string", - "description": "Filter by type", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "Sort by fields. Example: sort_by=id,name,-type,created_at,updated_at", - "name": "sort_by", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.SecretInfoList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "secret" - ], - "summary": "Create new secret", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.SecretCreate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.SecretInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/secrets/{id}": { - "delete": { - "tags": [ - "secret" - ], - "summary": "Delete secret", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "patch": { - "tags": [ - "secret" - ], - "summary": "Change secret", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.SecretPatch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.SecretInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/servers/{id}": { - "delete": { - "tags": [ - "cluster" - ], - "summary": "Delete server from cluster", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK", - "headers": { - "x-cluster-id": { - "type": "integer" - } - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/settings": { - "get": { - "tags": [ - "setting" - ], - "summary": "Get settings", - "parameters": [ - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Settings" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "setting" - ], - "summary": "Create new setting", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.CreateSetting" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Setting" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/settings/{name}": { - "patch": { - "tags": [ - "setting" - ], - "summary": "Changed setting", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ChangeSetting" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Setting" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/version": { - "get": { - "tags": [ - "system" - ], - "summary": "Get version of server", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Version" - } - } - } - } - } - }, - "definitions": { - "ClusterInfo": { - "description": "Cluster info", - "type": "object", - "properties": { - "cluster_location": { - "description": "Code of location", - "type": "string", - "example": "eu-north-1" - }, - "connection_info": { - "type": "object" - }, - "creation_time": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "description": { - "type": "string" - }, - "environment": { - "type": "string", - "example": "production" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string", - "example": "drm-prod-pgcluster" - }, - "postgres_version": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "project_name": { - "description": "Project for cluster", - "type": "string" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/definitions/ClusterInfo.Instance" - } - }, - "status": { - "type": "string", - "example": "healthy" - } - } - }, - "ClusterInfo.AdditionalSettings": { - "description": "Additional settings for cluster", - "type": "object", - "properties": { - "connection_info": { - "type": "object" - } - } - }, - "ClusterInfo.Instance": { - "description": "Instance info for current cluster", - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "ip": { - "type": "string", - "example": "10.128.64.141" - }, - "lag": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": 0 - }, - "name": { - "type": "string", - "example": "pgnode1" - }, - "pending_restart": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "role": { - "type": "string", - "example": "leader" - }, - "status": { - "type": "string" - }, - "tags": { - "type": "object" - }, - "timeline": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": 1 - } - } - }, - "Deployment.CloudImage": { - "type": "object", - "properties": { - "arch": { - "type": "string", - "example": "amd64" - }, - "image": { - "type": "object", - "example": "{\"server_image\": \"ami-078b3985bbc361448\"}" - }, - "os_name": { - "type": "string", - "example": "Ubuntu" - }, - "os_version": { - "type": "string", - "example": "22.04 LTS" - }, - "updated_at": { - "type": "string", - "format": "datetime" - } - } - }, - "Deployment.InstanceType": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "m5.2xlarge" - }, - "cpu": { - "type": "integer", - "example": 8 - }, - "currency": { - "description": "Price currency", - "type": "string", - "example": "$" - }, - "price_hourly": { - "description": "Price for 1 instance by hour", - "type": "number", - "example": 0.01 - }, - "price_monthly": { - "description": "Price for 1 instance by month", - "type": "number", - "example": 1.2 - }, - "ram": { - "type": "integer", - "example": 256 - } - } - }, - "DeploymentInfo.CloudRegion": { - "type": "object", - "properties": { - "code": { - "description": "unique parameter for DB", - "type": "string", - "example": "north_america" - }, - "datacenters": { - "description": "List of datacenters for this region", - "type": "array", - "items": { - "type": "object", - "properties": { - "cloud_image": { - "$ref": "#/definitions/Deployment.CloudImage" - }, - "code": { - "type": "string", - "example": "ca-central-1" - }, - "location": { - "type": "string", - "example": "Canada (central)" - } - } - } - }, - "name": { - "description": "Field for web", - "type": "string", - "example": "North America" - } - } - }, - "Meta.Pagination": { - "type": "object", - "title": "Pagination info for list requests", - "properties": { - "count": { - "type": "integer", - "x-nullable": true - }, - "limit": { - "type": "integer", - "x-nullable": true - }, - "offset": { - "type": "integer", - "x-nullable": true - } - } - }, - "Request.ChangeSetting": { - "description": "Change setting", - "type": "object", - "properties": { - "value": { - "type": "object", - "x-nullable": true - } - } - }, - "Request.ClusterCreate": { - "description": "Request struct for cluster creation", - "type": "object", - "properties": { - "auth_info": { - "description": "Info for deployment system authorization", - "type": "object", - "properties": { - "secret_id": { - "type": "integer", - "example": 1 - } - } - }, - "description": { - "description": "Info about cluster", - "type": "string" - }, - "environment_id": { - "description": "Project environment", - "type": "integer" - }, - "envs": { - "type": "array", - "items": { - "type": "string" - } - }, - "extra_vars": { - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "type": "string", - "example": "drm-prod-pgcluster" - }, - "project_id": { - "description": "Project for new cluster", - "type": "integer" - } - } - }, - "Request.ClusterReinit": { - "description": "Reinit cluster", - "type": "object" - }, - "Request.ClusterReload": { - "description": "Reload cluster", - "type": "object" - }, - "Request.ClusterRemove": { - "description": "Remove cluster", - "type": "object" - }, - "Request.ClusterRestart": { - "description": "Restart cluster", - "type": "object" - }, - "Request.ClusterStart": { - "description": "Start cluster", - "type": "object" - }, - "Request.ClusterStop": { - "description": "Stop cluster", - "type": "object" - }, - "Request.CreateSetting": { - "description": "Create new setting", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "object" - } - } - }, - "Request.Environment": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "environment for production" - }, - "name": { - "type": "string", - "example": "production" - } - } - }, - "Request.ProjectCreate": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Default project" - }, - "name": { - "type": "string", - "example": "default" - } - } - }, - "Request.ProjectPatch": { - "type": "object", - "properties": { - "description": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "x-nullable": true - } - } - }, - "Request.SecretCreate": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "aws key" - }, - "project_id": { - "type": "integer", - "example": 1 - }, - "type": { - "$ref": "#/definitions/Secret.Type" - }, - "value": { - "type": "object", - "$ref": "#/definitions/Request.SecretValue" - } - } - }, - "Request.SecretPatch": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-nullable": true, - "example": "aws key" - }, - "type": { - "type": "string", - "x-nullable": true, - "example": "aws" - }, - "value": { - "description": "Secret value in base64", - "type": "string", - "x-nullable": true, - "example": "c2VjcmV0" - } - } - }, - "Request.SecretValue": { - "type": "object", - "properties": { - "aws": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Aws" - }, - "azure": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Azure" - }, - "digitalocean": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.DigitalOcean" - }, - "gcp": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Gcp" - }, - "hetzner": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Hetzner" - }, - "password": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Password" - }, - "ssh_key": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.SshKey" - } - } - }, - "Request.SecretValue.Aws": { - "type": "object", - "properties": { - "AWS_ACCESS_KEY_ID": { - "type": "string" - }, - "AWS_SECRET_ACCESS_KEY": { - "type": "string" - } - } - }, - "Request.SecretValue.Azure": { - "type": "object", - "properties": { - "AZURE_CLIENT_ID": { - "type": "string" - }, - "AZURE_SECRET": { - "type": "string" - }, - "AZURE_SUBSCRIPTION_ID": { - "type": "string" - }, - "AZURE_TENANT": { - "type": "string" - } - } - }, - "Request.SecretValue.DigitalOcean": { - "type": "object", - "properties": { - "DO_API_TOKEN": { - "type": "string" - } - } - }, - "Request.SecretValue.Gcp": { - "type": "object", - "properties": { - "GCP_SERVICE_ACCOUNT_CONTENTS": { - "type": "string" - } - } - }, - "Request.SecretValue.Hetzner": { - "type": "object", - "properties": { - "HCLOUD_API_TOKEN": { - "type": "string" - } - } - }, - "Request.SecretValue.Password": { - "type": "object", - "properties": { - "PASSWORD": { - "type": "string" - }, - "USERNAME": { - "type": "string" - } - } - }, - "Request.SecretValue.SshKey": { - "type": "object", - "properties": { - "SSH_PRIVATE_KEY": { - "type": "string" - } - } - }, - "Response.ClusterCreate": { - "description": "Response struct for cluster creation", - "type": "object", - "properties": { - "cluster_id": { - "description": "unique code for cluster", - "type": "integer" - }, - "operation_id": { - "description": "operation id", - "type": "integer" - } - } - }, - "Response.ClusterDefaultName": { - "description": "Response struct for cluster default name", - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "postgres-cluster-01" - } - } - }, - "Response.ClusterLogs": { - "description": "Logs for cluster", - "type": "object", - "properties": { - "logs": { - "description": "all available logs", - "type": "string" - } - } - }, - "Response.ClustersInfo": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/ClusterInfo" - } - }, - "meta": { - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.DatabaseExtension": { - "description": "Info about database extension", - "type": "object", - "properties": { - "contrib": { - "type": "boolean", - "example": false - }, - "description": { - "type": "string", - "x-nullable": true, - "example": "Citus is PostgreSQL extension that transforms..." - }, - "image": { - "type": "string", - "x-nullable": true, - "example": "citus.png" - }, - "name": { - "type": "string", - "example": "Citus" - }, - "postgres_max_version": { - "type": "string", - "x-nullable": true, - "example": "16" - }, - "postgres_min_version": { - "type": "string", - "x-nullable": true, - "example": "11" - }, - "url": { - "type": "string", - "x-nullable": true, - "example": "https://github.com/citusdata/citus" - } - } - }, - "Response.DatabaseExtensions": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.DatabaseExtension" - } - }, - "meta": { - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.DeploymentInfo": { - "description": "Deployment info", - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "cloud_regions": { - "description": "List of available regions for current deployment", - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentInfo.CloudRegion" - } - }, - "code": { - "type": "string", - "example": "aws" - }, - "description": { - "type": "string", - "example": "Amazon web services" - }, - "instance_types": { - "description": "Lists of available instance types", - "type": "object", - "properties": { - "large": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - } - }, - "medium": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - } - }, - "small": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - }, - "x-nullable": true - } - } - }, - "volumes": { - "description": "Hardware disks info", - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "description": "Price currency", - "type": "string", - "example": "$" - }, - "is_default": { - "description": "Default volume", - "type": "boolean", - "x-nullable": true, - "example": false - }, - "max_size": { - "description": "Sets in GB", - "type": "integer", - "example": 256 - }, - "min_size": { - "description": "Sets in GB", - "type": "integer", - "example": 10 - }, - "price_monthly": { - "description": "Price for disk by months", - "type": "number", - "example": 0.1 - }, - "volume_description": { - "description": "Volume description", - "type": "string", - "example": "General purpose SSD disk" - }, - "volume_type": { - "description": "Volume type", - "type": "string", - "example": "gp3" - } - } - } - } - } - }, - "Response.DeploymentsInfo": { - "type": "object", - "title": "Deployments info", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.DeploymentInfo" - } - }, - "meta": { - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Environment": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "description": { - "type": "string", - "x-nullable": true, - "example": "environment for production" - }, - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "production" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - } - } - }, - "Response.EnvironmentsList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Environment" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Error": { - "type": "object", - "title": "Error object", - "properties": { - "code": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "Response.Operation": { - "type": "object", - "properties": { - "cluster_name": { - "type": "string", - "example": "drm-prod-cluster" - }, - "environment": { - "type": "string", - "example": "production" - }, - "finished": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - }, - "id": { - "type": "integer", - "example": 1 - }, - "started": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "status": { - "type": "string", - "example": "success" - }, - "type": { - "type": "string", - "example": "deploy" - } - } - }, - "Response.OperationsList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Operation" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.PostgresVersion": { - "type": "object", - "properties": { - "end_of_life": { - "type": "string", - "format": "date", - "example": "2022-11-10" - }, - "major_version": { - "type": "integer", - "example": 10 - }, - "release_date": { - "type": "string", - "format": "date", - "example": "2017-10-05" - } - } - }, - "Response.PostgresVersions": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.PostgresVersion" - } - } - } - }, - "Response.Project": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "description": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - } - } - }, - "Response.ProjectsList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Project" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.SecretInfo": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "id": { - "type": "integer", - "example": 1 - }, - "is_used": { - "type": "boolean", - "example": "true" - }, - "name": { - "type": "string", - "example": "aws key" - }, - "project_id": { - "type": "integer", - "example": 1 - }, - "type": { - "$ref": "#/definitions/Secret.Type" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - }, - "used_by_clusters": { - "type": "string", - "x-nullable": true, - "example": "mds-prod, drm-prod" - } - } - }, - "Response.SecretInfoList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.SecretInfo" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Setting": { - "description": "Setting", - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "datetime" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string", - "format": "datetime", - "x-nullable": true - }, - "value": { - "type": "object" - } - } - }, - "Response.Settings": { - "description": "List of settings", - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Setting" - } - }, - "mete": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Version": { - "type": "object", - "title": "Version response", - "properties": { - "version": { - "type": "string", - "example": "v1.0.0" - } - } - }, - "Secret.Type": { - "type": "string", - "enum": [ - "aws", - "gcp", - "hetzner", - "ssh_key", - "digitalocean", - "password", - "azure" - ] - } - } -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "API for PG Console WEB", - "title": "PG Console", - "version": "1.0.0" - }, - "host": "localhost:8080", - "basePath": "/api/v1", - "paths": { - "/clusters": { - "get": { - "tags": [ - "cluster" - ], - "summary": "Get info about clusters", - "parameters": [ - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "project_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - }, - { - "type": "string", - "description": "Filter by status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "Filter by location", - "name": "location", - "in": "query" - }, - { - "type": "string", - "description": "Filter by environment", - "name": "environment", - "in": "query" - }, - { - "type": "integer", - "description": "Filter by server_count", - "name": "server_count", - "in": "query" - }, - { - "type": "integer", - "description": "Filter by postgres_version", - "name": "postgres_version", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Created at after this date", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Created at till this date", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Sort by fields. Example: sort_by=id,-name,created_at,updated_at\n Supported values:\n - id\n - name\n - created_at\n - updated_at\n - environment\n - project\n - status\n - location\n - server_count\n - postgres_version\n", - "name": "sort_by", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClustersInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "cluster" - ], - "summary": "Create new cluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterCreate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/default_name": { - "get": { - "tags": [ - "cluster" - ], - "summary": "Get cluster default name", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterDefaultName" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}": { - "get": { - "tags": [ - "cluster" - ], - "summary": "Get cluster info", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ClusterInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "delete": { - "tags": [ - "cluster" - ], - "summary": "Delete cluster", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/refresh": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Refresh cluster info", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ClusterInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/reinit": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Reinit cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterReinit" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/reload": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Reload cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterReload" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/remove": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Remove cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterRemove" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/restart": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Restart cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterRestart" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/start": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Start cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterStart" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/clusters/{id}/stop": { - "post": { - "tags": [ - "cluster" - ], - "summary": "Stop cluster", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ClusterStop" - } - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ClusterCreate" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/database/extensions": { - "get": { - "tags": [ - "dictionary" - ], - "summary": "Info about available database extensions", - "parameters": [ - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "enum": [ - "all", - "contrib", - "third_party" - ], - "type": "string", - "default": "all", - "name": "extension_type", - "in": "query" - }, - { - "type": "string", - "name": "postgres_version", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.DatabaseExtensions" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/environments": { - "get": { - "tags": [ - "environment" - ], - "summary": "Get environemtns list", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.EnvironmentsList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "environment" - ], - "summary": "Create environemtn", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.Environment" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Environment" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/environments/{id}": { - "delete": { - "tags": [ - "environment" - ], - "summary": "Delete environment", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/external/deployments": { - "get": { - "tags": [ - "dictionary" - ], - "summary": "Get full info about available external deployments", - "parameters": [ - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.DeploymentsInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/operations": { - "get": { - "tags": [ - "operation" - ], - "summary": "Get operations list for current project", - "parameters": [ - { - "type": "integer", - "description": "Required parameter for filter", - "name": "project_id", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Operations started after this date", - "name": "start_date", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Operations started till this date", - "name": "end_date", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Filter by cluster_name", - "name": "cluster_name", - "in": "query" - }, - { - "type": "string", - "description": "Filter by type", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "Filter by status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "Filter by environment", - "name": "environment", - "in": "query" - }, - { - "type": "string", - "description": "Sort by fields. Example: sort_by=cluster_name,-type,status,id,created_at,updated_at\n Supported valuese:\n - id\n - cluster_name\n - type\n - status\n - started_at\n - updated_at\n - cluster\n - environment\n", - "name": "sort_by", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.OperationsList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/operations/{id}/log": { - "get": { - "consumes": [ - "plain/text" - ], - "tags": [ - "operation" - ], - "summary": "Get operation log by operation_id", - "parameters": [ - { - "type": "integer", - "description": "Operation id", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - }, - "headers": { - "content-type": { - "type": "string" - }, - "x-log-completed": { - "type": "boolean" - } - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/postgres_versions": { - "get": { - "tags": [ - "dictionary" - ], - "summary": "Get supported postgres versions", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.PostgresVersions" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/projects": { - "get": { - "tags": [ - "project" - ], - "summary": "Get projects list", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.ProjectsList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "project" - ], - "summary": "Create new project", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ProjectCreate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Project" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/projects/{id}": { - "delete": { - "tags": [ - "project" - ], - "summary": "Delete project", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "patch": { - "tags": [ - "project" - ], - "summary": "Change project", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ProjectPatch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Project" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/secrets": { - "get": { - "tags": [ - "secret" - ], - "summary": "Get secrets list", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "project_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - }, - { - "type": "string", - "description": "Filter by type", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "Sort by fields. Example: sort_by=id,name,-type,created_at,updated_at", - "name": "sort_by", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.SecretInfoList" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "secret" - ], - "summary": "Create new secret", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.SecretCreate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.SecretInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/secrets/{id}": { - "delete": { - "tags": [ - "secret" - ], - "summary": "Delete secret", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK" - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "patch": { - "tags": [ - "secret" - ], - "summary": "Change secret", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.SecretPatch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.SecretInfo" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/servers/{id}": { - "delete": { - "tags": [ - "cluster" - ], - "summary": "Delete server from cluster", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "OK", - "headers": { - "x-cluster-id": { - "type": "integer" - } - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/settings": { - "get": { - "tags": [ - "setting" - ], - "summary": "Get settings", - "parameters": [ - { - "type": "string", - "description": "Filter by name", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "integer", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Settings" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - }, - "post": { - "tags": [ - "setting" - ], - "summary": "Create new setting", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.CreateSetting" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Setting" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/settings/{name}": { - "patch": { - "tags": [ - "setting" - ], - "summary": "Changed setting", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Request.ChangeSetting" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Setting" - } - }, - "400": { - "description": "Error", - "schema": { - "$ref": "#/definitions/Response.Error" - } - } - } - } - }, - "/version": { - "get": { - "tags": [ - "system" - ], - "summary": "Get version of server", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Response.Version" - } - } - } - } - } - }, - "definitions": { - "ClusterInfo": { - "description": "Cluster info", - "type": "object", - "properties": { - "cluster_location": { - "description": "Code of location", - "type": "string", - "example": "eu-north-1" - }, - "connection_info": { - "type": "object" - }, - "creation_time": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "description": { - "type": "string" - }, - "environment": { - "type": "string", - "example": "production" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string", - "example": "drm-prod-pgcluster" - }, - "postgres_version": { - "type": "integer", - "format": "int32", - "example": 15 - }, - "project_name": { - "description": "Project for cluster", - "type": "string" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/definitions/ClusterInfo.Instance" - } - }, - "status": { - "type": "string", - "example": "healthy" - } - } - }, - "ClusterInfo.AdditionalSettings": { - "description": "Additional settings for cluster", - "type": "object", - "properties": { - "connection_info": { - "type": "object" - } - } - }, - "ClusterInfo.Instance": { - "description": "Instance info for current cluster", - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "ip": { - "type": "string", - "example": "10.128.64.141" - }, - "lag": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": 0 - }, - "name": { - "type": "string", - "example": "pgnode1" - }, - "pending_restart": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "role": { - "type": "string", - "example": "leader" - }, - "status": { - "type": "string" - }, - "tags": { - "type": "object" - }, - "timeline": { - "type": "integer", - "format": "int64", - "x-nullable": true, - "example": 1 - } - } - }, - "Deployment.CloudImage": { - "type": "object", - "properties": { - "arch": { - "type": "string", - "example": "amd64" - }, - "image": { - "type": "object", - "example": "{\"server_image\": \"ami-078b3985bbc361448\"}" - }, - "os_name": { - "type": "string", - "example": "Ubuntu" - }, - "os_version": { - "type": "string", - "example": "22.04 LTS" - }, - "updated_at": { - "type": "string", - "format": "datetime" - } - } - }, - "Deployment.InstanceType": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "m5.2xlarge" - }, - "cpu": { - "type": "integer", - "example": 8 - }, - "currency": { - "description": "Price currency", - "type": "string", - "example": "$" - }, - "price_hourly": { - "description": "Price for 1 instance by hour", - "type": "number", - "example": 0.01 - }, - "price_monthly": { - "description": "Price for 1 instance by month", - "type": "number", - "example": 1.2 - }, - "ram": { - "type": "integer", - "example": 256 - } - } - }, - "DeploymentInfo.CloudRegion": { - "type": "object", - "properties": { - "code": { - "description": "unique parameter for DB", - "type": "string", - "example": "north_america" - }, - "datacenters": { - "description": "List of datacenters for this region", - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentInfoCloudRegionDatacentersItems0" - } - }, - "name": { - "description": "Field for web", - "type": "string", - "example": "North America" - } - } - }, - "DeploymentInfoCloudRegionDatacentersItems0": { - "type": "object", - "properties": { - "cloud_image": { - "$ref": "#/definitions/Deployment.CloudImage" - }, - "code": { - "type": "string", - "example": "ca-central-1" - }, - "location": { - "type": "string", - "example": "Canada (central)" - } - } - }, - "Meta.Pagination": { - "type": "object", - "title": "Pagination info for list requests", - "properties": { - "count": { - "type": "integer", - "x-nullable": true - }, - "limit": { - "type": "integer", - "x-nullable": true - }, - "offset": { - "type": "integer", - "x-nullable": true - } - } - }, - "Request.ChangeSetting": { - "description": "Change setting", - "type": "object", - "properties": { - "value": { - "type": "object", - "x-nullable": true - } - } - }, - "Request.ClusterCreate": { - "description": "Request struct for cluster creation", - "type": "object", - "properties": { - "auth_info": { - "description": "Info for deployment system authorization", - "type": "object", - "properties": { - "secret_id": { - "type": "integer", - "example": 1 - } - } - }, - "description": { - "description": "Info about cluster", - "type": "string" - }, - "environment_id": { - "description": "Project environment", - "type": "integer" - }, - "envs": { - "type": "array", - "items": { - "type": "string" - } - }, - "extra_vars": { - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "type": "string", - "example": "drm-prod-pgcluster" - }, - "project_id": { - "description": "Project for new cluster", - "type": "integer" - } - } - }, - "Request.ClusterReinit": { - "description": "Reinit cluster", - "type": "object" - }, - "Request.ClusterReload": { - "description": "Reload cluster", - "type": "object" - }, - "Request.ClusterRemove": { - "description": "Remove cluster", - "type": "object" - }, - "Request.ClusterRestart": { - "description": "Restart cluster", - "type": "object" - }, - "Request.ClusterStart": { - "description": "Start cluster", - "type": "object" - }, - "Request.ClusterStop": { - "description": "Stop cluster", - "type": "object" - }, - "Request.CreateSetting": { - "description": "Create new setting", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "object" - } - } - }, - "Request.Environment": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "environment for production" - }, - "name": { - "type": "string", - "example": "production" - } - } - }, - "Request.ProjectCreate": { - "type": "object", - "properties": { - "description": { - "type": "string", - "example": "Default project" - }, - "name": { - "type": "string", - "example": "default" - } - } - }, - "Request.ProjectPatch": { - "type": "object", - "properties": { - "description": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "x-nullable": true - } - } - }, - "Request.SecretCreate": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "aws key" - }, - "project_id": { - "type": "integer", - "example": 1 - }, - "type": { - "$ref": "#/definitions/Secret.Type" - }, - "value": { - "type": "object", - "$ref": "#/definitions/Request.SecretValue" - } - } - }, - "Request.SecretPatch": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-nullable": true, - "example": "aws key" - }, - "type": { - "type": "string", - "x-nullable": true, - "example": "aws" - }, - "value": { - "description": "Secret value in base64", - "type": "string", - "x-nullable": true, - "example": "c2VjcmV0" - } - } - }, - "Request.SecretValue": { - "type": "object", - "properties": { - "aws": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Aws" - }, - "azure": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Azure" - }, - "digitalocean": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.DigitalOcean" - }, - "gcp": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Gcp" - }, - "hetzner": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Hetzner" - }, - "password": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.Password" - }, - "ssh_key": { - "type": "object", - "x-nullable": true, - "$ref": "#/definitions/Request.SecretValue.SshKey" - } - } - }, - "Request.SecretValue.Aws": { - "type": "object", - "properties": { - "AWS_ACCESS_KEY_ID": { - "type": "string" - }, - "AWS_SECRET_ACCESS_KEY": { - "type": "string" - } - } - }, - "Request.SecretValue.Azure": { - "type": "object", - "properties": { - "AZURE_CLIENT_ID": { - "type": "string" - }, - "AZURE_SECRET": { - "type": "string" - }, - "AZURE_SUBSCRIPTION_ID": { - "type": "string" - }, - "AZURE_TENANT": { - "type": "string" - } - } - }, - "Request.SecretValue.DigitalOcean": { - "type": "object", - "properties": { - "DO_API_TOKEN": { - "type": "string" - } - } - }, - "Request.SecretValue.Gcp": { - "type": "object", - "properties": { - "GCP_SERVICE_ACCOUNT_CONTENTS": { - "type": "string" - } - } - }, - "Request.SecretValue.Hetzner": { - "type": "object", - "properties": { - "HCLOUD_API_TOKEN": { - "type": "string" - } - } - }, - "Request.SecretValue.Password": { - "type": "object", - "properties": { - "PASSWORD": { - "type": "string" - }, - "USERNAME": { - "type": "string" - } - } - }, - "Request.SecretValue.SshKey": { - "type": "object", - "properties": { - "SSH_PRIVATE_KEY": { - "type": "string" - } - } - }, - "RequestClusterCreateAuthInfo": { - "description": "Info for deployment system authorization", - "type": "object", - "properties": { - "secret_id": { - "type": "integer", - "example": 1 - } - } - }, - "Response.ClusterCreate": { - "description": "Response struct for cluster creation", - "type": "object", - "properties": { - "cluster_id": { - "description": "unique code for cluster", - "type": "integer" - }, - "operation_id": { - "description": "operation id", - "type": "integer" - } - } - }, - "Response.ClusterDefaultName": { - "description": "Response struct for cluster default name", - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "postgres-cluster-01" - } - } - }, - "Response.ClusterLogs": { - "description": "Logs for cluster", - "type": "object", - "properties": { - "logs": { - "description": "all available logs", - "type": "string" - } - } - }, - "Response.ClustersInfo": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/ClusterInfo" - } - }, - "meta": { - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.DatabaseExtension": { - "description": "Info about database extension", - "type": "object", - "properties": { - "contrib": { - "type": "boolean", - "example": false - }, - "description": { - "type": "string", - "x-nullable": true, - "example": "Citus is PostgreSQL extension that transforms..." - }, - "image": { - "type": "string", - "x-nullable": true, - "example": "citus.png" - }, - "name": { - "type": "string", - "example": "Citus" - }, - "postgres_max_version": { - "type": "string", - "x-nullable": true, - "example": "16" - }, - "postgres_min_version": { - "type": "string", - "x-nullable": true, - "example": "11" - }, - "url": { - "type": "string", - "x-nullable": true, - "example": "https://github.com/citusdata/citus" - } - } - }, - "Response.DatabaseExtensions": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.DatabaseExtension" - } - }, - "meta": { - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.DeploymentInfo": { - "description": "Deployment info", - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "cloud_regions": { - "description": "List of available regions for current deployment", - "type": "array", - "items": { - "$ref": "#/definitions/DeploymentInfo.CloudRegion" - } - }, - "code": { - "type": "string", - "example": "aws" - }, - "description": { - "type": "string", - "example": "Amazon web services" - }, - "instance_types": { - "description": "Lists of available instance types", - "type": "object", - "properties": { - "large": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - } - }, - "medium": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - } - }, - "small": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - }, - "x-nullable": true - } - } - }, - "volumes": { - "description": "Hardware disks info", - "type": "array", - "items": { - "$ref": "#/definitions/ResponseDeploymentInfoVolumesItems0" - } - } - } - }, - "Response.DeploymentsInfo": { - "type": "object", - "title": "Deployments info", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.DeploymentInfo" - } - }, - "meta": { - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Environment": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "description": { - "type": "string", - "x-nullable": true, - "example": "environment for production" - }, - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "production" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - } - } - }, - "Response.EnvironmentsList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Environment" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Error": { - "type": "object", - "title": "Error object", - "properties": { - "code": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "Response.Operation": { - "type": "object", - "properties": { - "cluster_name": { - "type": "string", - "example": "drm-prod-cluster" - }, - "environment": { - "type": "string", - "example": "production" - }, - "finished": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - }, - "id": { - "type": "integer", - "example": 1 - }, - "started": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "status": { - "type": "string", - "example": "success" - }, - "type": { - "type": "string", - "example": "deploy" - } - } - }, - "Response.OperationsList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Operation" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.PostgresVersion": { - "type": "object", - "properties": { - "end_of_life": { - "type": "string", - "format": "date", - "example": "2022-11-10" - }, - "major_version": { - "type": "integer", - "example": 10 - }, - "release_date": { - "type": "string", - "format": "date", - "example": "2017-10-05" - } - } - }, - "Response.PostgresVersions": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.PostgresVersion" - } - } - } - }, - "Response.Project": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "description": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - } - } - }, - "Response.ProjectsList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Project" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.SecretInfo": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "16.10.2023T11:20:00Z" - }, - "id": { - "type": "integer", - "example": 1 - }, - "is_used": { - "type": "boolean", - "example": "true" - }, - "name": { - "type": "string", - "example": "aws key" - }, - "project_id": { - "type": "integer", - "example": 1 - }, - "type": { - "$ref": "#/definitions/Secret.Type" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "16.10.2023T11:20:00Z" - }, - "used_by_clusters": { - "type": "string", - "x-nullable": true, - "example": "mds-prod, drm-prod" - } - } - }, - "Response.SecretInfoList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.SecretInfo" - } - }, - "meta": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Setting": { - "description": "Setting", - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "datetime" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string", - "format": "datetime", - "x-nullable": true - }, - "value": { - "type": "object" - } - } - }, - "Response.Settings": { - "description": "List of settings", - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Response.Setting" - } - }, - "mete": { - "type": "object", - "$ref": "#/definitions/Meta.Pagination" - } - } - }, - "Response.Version": { - "type": "object", - "title": "Version response", - "properties": { - "version": { - "type": "string", - "example": "v1.0.0" - } - } - }, - "ResponseDeploymentInfoInstanceTypes": { - "description": "Lists of available instance types", - "type": "object", - "properties": { - "large": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - } - }, - "medium": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - } - }, - "small": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment.InstanceType" - }, - "x-nullable": true - } - } - }, - "ResponseDeploymentInfoVolumesItems0": { - "type": "object", - "properties": { - "currency": { - "description": "Price currency", - "type": "string", - "example": "$" - }, - "is_default": { - "description": "Default volume", - "type": "boolean", - "x-nullable": true, - "example": false - }, - "max_size": { - "description": "Sets in GB", - "type": "integer", - "example": 256 - }, - "min_size": { - "description": "Sets in GB", - "type": "integer", - "example": 10 - }, - "price_monthly": { - "description": "Price for disk by months", - "type": "number", - "example": 0.1 - }, - "volume_description": { - "description": "Volume description", - "type": "string", - "example": "General purpose SSD disk" - }, - "volume_type": { - "description": "Volume type", - "type": "string", - "example": "gp3" - } - } - }, - "Secret.Type": { - "type": "string", - "enum": [ - "aws", - "gcp", - "hetzner", - "ssh_key", - "digitalocean", - "password", - "azure" - ] - } - } -}`)) -} diff --git a/console/service/restapi/operations/cluster/delete_clusters_id.go b/console/service/restapi/operations/cluster/delete_clusters_id.go deleted file mode 100644 index 9894c8295..000000000 --- a/console/service/restapi/operations/cluster/delete_clusters_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteClustersIDHandlerFunc turns a function with the right signature into a delete clusters ID handler -type DeleteClustersIDHandlerFunc func(DeleteClustersIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteClustersIDHandlerFunc) Handle(params DeleteClustersIDParams) middleware.Responder { - return fn(params) -} - -// DeleteClustersIDHandler interface for that can handle valid delete clusters ID params -type DeleteClustersIDHandler interface { - Handle(DeleteClustersIDParams) middleware.Responder -} - -// NewDeleteClustersID creates a new http.Handler for the delete clusters ID operation -func NewDeleteClustersID(ctx *middleware.Context, handler DeleteClustersIDHandler) *DeleteClustersID { - return &DeleteClustersID{Context: ctx, Handler: handler} -} - -/* - DeleteClustersID swagger:route DELETE /clusters/{id} cluster deleteClustersId - -Delete cluster -*/ -type DeleteClustersID struct { - Context *middleware.Context - Handler DeleteClustersIDHandler -} - -func (o *DeleteClustersID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteClustersIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/delete_clusters_id_parameters.go b/console/service/restapi/operations/cluster/delete_clusters_id_parameters.go deleted file mode 100644 index a0a865273..000000000 --- a/console/service/restapi/operations/cluster/delete_clusters_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewDeleteClustersIDParams creates a new DeleteClustersIDParams object -// -// There are no default values defined in the spec. -func NewDeleteClustersIDParams() DeleteClustersIDParams { - - return DeleteClustersIDParams{} -} - -// DeleteClustersIDParams contains all the bound params for the delete clusters ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteClustersID -type DeleteClustersIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteClustersIDParams() beforehand. -func (o *DeleteClustersIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteClustersIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/delete_clusters_id_responses.go b/console/service/restapi/operations/cluster/delete_clusters_id_responses.go deleted file mode 100644 index 046bd3dd3..000000000 --- a/console/service/restapi/operations/cluster/delete_clusters_id_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// DeleteClustersIDNoContentCode is the HTTP code returned for type DeleteClustersIDNoContent -const DeleteClustersIDNoContentCode int = 204 - -/* -DeleteClustersIDNoContent OK - -swagger:response deleteClustersIdNoContent -*/ -type DeleteClustersIDNoContent struct { -} - -// NewDeleteClustersIDNoContent creates DeleteClustersIDNoContent with default headers values -func NewDeleteClustersIDNoContent() *DeleteClustersIDNoContent { - - return &DeleteClustersIDNoContent{} -} - -// WriteResponse to the client -func (o *DeleteClustersIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteClustersIDBadRequestCode is the HTTP code returned for type DeleteClustersIDBadRequest -const DeleteClustersIDBadRequestCode int = 400 - -/* -DeleteClustersIDBadRequest Error - -swagger:response deleteClustersIdBadRequest -*/ -type DeleteClustersIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewDeleteClustersIDBadRequest creates DeleteClustersIDBadRequest with default headers values -func NewDeleteClustersIDBadRequest() *DeleteClustersIDBadRequest { - - return &DeleteClustersIDBadRequest{} -} - -// WithPayload adds the payload to the delete clusters Id bad request response -func (o *DeleteClustersIDBadRequest) WithPayload(payload *models.ResponseError) *DeleteClustersIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete clusters Id bad request response -func (o *DeleteClustersIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteClustersIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/delete_clusters_id_urlbuilder.go b/console/service/restapi/operations/cluster/delete_clusters_id_urlbuilder.go deleted file mode 100644 index 7eebf0b6d..000000000 --- a/console/service/restapi/operations/cluster/delete_clusters_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// DeleteClustersIDURL generates an URL for the delete clusters ID operation -type DeleteClustersIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteClustersIDURL) WithBasePath(bp string) *DeleteClustersIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteClustersIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteClustersIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteClustersIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteClustersIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteClustersIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteClustersIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteClustersIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteClustersIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteClustersIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/delete_servers_id.go b/console/service/restapi/operations/cluster/delete_servers_id.go deleted file mode 100644 index cd4f5b96d..000000000 --- a/console/service/restapi/operations/cluster/delete_servers_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteServersIDHandlerFunc turns a function with the right signature into a delete servers ID handler -type DeleteServersIDHandlerFunc func(DeleteServersIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteServersIDHandlerFunc) Handle(params DeleteServersIDParams) middleware.Responder { - return fn(params) -} - -// DeleteServersIDHandler interface for that can handle valid delete servers ID params -type DeleteServersIDHandler interface { - Handle(DeleteServersIDParams) middleware.Responder -} - -// NewDeleteServersID creates a new http.Handler for the delete servers ID operation -func NewDeleteServersID(ctx *middleware.Context, handler DeleteServersIDHandler) *DeleteServersID { - return &DeleteServersID{Context: ctx, Handler: handler} -} - -/* - DeleteServersID swagger:route DELETE /servers/{id} cluster deleteServersId - -Delete server from cluster -*/ -type DeleteServersID struct { - Context *middleware.Context - Handler DeleteServersIDHandler -} - -func (o *DeleteServersID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteServersIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/delete_servers_id_parameters.go b/console/service/restapi/operations/cluster/delete_servers_id_parameters.go deleted file mode 100644 index 66c4b8ffc..000000000 --- a/console/service/restapi/operations/cluster/delete_servers_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewDeleteServersIDParams creates a new DeleteServersIDParams object -// -// There are no default values defined in the spec. -func NewDeleteServersIDParams() DeleteServersIDParams { - - return DeleteServersIDParams{} -} - -// DeleteServersIDParams contains all the bound params for the delete servers ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteServersID -type DeleteServersIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteServersIDParams() beforehand. -func (o *DeleteServersIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteServersIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/delete_servers_id_responses.go b/console/service/restapi/operations/cluster/delete_servers_id_responses.go deleted file mode 100644 index 97c1a40d5..000000000 --- a/console/service/restapi/operations/cluster/delete_servers_id_responses.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// DeleteServersIDNoContentCode is the HTTP code returned for type DeleteServersIDNoContent -const DeleteServersIDNoContentCode int = 204 - -/* -DeleteServersIDNoContent OK - -swagger:response deleteServersIdNoContent -*/ -type DeleteServersIDNoContent struct { - /* - - */ - XClusterID int64 `json:"x-cluster-id"` -} - -// NewDeleteServersIDNoContent creates DeleteServersIDNoContent with default headers values -func NewDeleteServersIDNoContent() *DeleteServersIDNoContent { - - return &DeleteServersIDNoContent{} -} - -// WithXClusterID adds the xClusterId to the delete servers Id no content response -func (o *DeleteServersIDNoContent) WithXClusterID(xClusterID int64) *DeleteServersIDNoContent { - o.XClusterID = xClusterID - return o -} - -// SetXClusterID sets the xClusterId to the delete servers Id no content response -func (o *DeleteServersIDNoContent) SetXClusterID(xClusterID int64) { - o.XClusterID = xClusterID -} - -// WriteResponse to the client -func (o *DeleteServersIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header x-cluster-id - - xClusterID := swag.FormatInt64(o.XClusterID) - if xClusterID != "" { - rw.Header().Set("x-cluster-id", xClusterID) - } - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteServersIDBadRequestCode is the HTTP code returned for type DeleteServersIDBadRequest -const DeleteServersIDBadRequestCode int = 400 - -/* -DeleteServersIDBadRequest Error - -swagger:response deleteServersIdBadRequest -*/ -type DeleteServersIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewDeleteServersIDBadRequest creates DeleteServersIDBadRequest with default headers values -func NewDeleteServersIDBadRequest() *DeleteServersIDBadRequest { - - return &DeleteServersIDBadRequest{} -} - -// WithPayload adds the payload to the delete servers Id bad request response -func (o *DeleteServersIDBadRequest) WithPayload(payload *models.ResponseError) *DeleteServersIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete servers Id bad request response -func (o *DeleteServersIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServersIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/delete_servers_id_urlbuilder.go b/console/service/restapi/operations/cluster/delete_servers_id_urlbuilder.go deleted file mode 100644 index cda5d3b94..000000000 --- a/console/service/restapi/operations/cluster/delete_servers_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// DeleteServersIDURL generates an URL for the delete servers ID operation -type DeleteServersIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServersIDURL) WithBasePath(bp string) *DeleteServersIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServersIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteServersIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/servers/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteServersIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteServersIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteServersIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteServersIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteServersIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteServersIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteServersIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/get_clusters.go b/console/service/restapi/operations/cluster/get_clusters.go deleted file mode 100644 index a52820fe0..000000000 --- a/console/service/restapi/operations/cluster/get_clusters.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetClustersHandlerFunc turns a function with the right signature into a get clusters handler -type GetClustersHandlerFunc func(GetClustersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetClustersHandlerFunc) Handle(params GetClustersParams) middleware.Responder { - return fn(params) -} - -// GetClustersHandler interface for that can handle valid get clusters params -type GetClustersHandler interface { - Handle(GetClustersParams) middleware.Responder -} - -// NewGetClusters creates a new http.Handler for the get clusters operation -func NewGetClusters(ctx *middleware.Context, handler GetClustersHandler) *GetClusters { - return &GetClusters{Context: ctx, Handler: handler} -} - -/* - GetClusters swagger:route GET /clusters cluster getClusters - -Get info about clusters -*/ -type GetClusters struct { - Context *middleware.Context - Handler GetClustersHandler -} - -func (o *GetClusters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetClustersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/get_clusters_default_name.go b/console/service/restapi/operations/cluster/get_clusters_default_name.go deleted file mode 100644 index 114a624d3..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_default_name.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetClustersDefaultNameHandlerFunc turns a function with the right signature into a get clusters default name handler -type GetClustersDefaultNameHandlerFunc func(GetClustersDefaultNameParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetClustersDefaultNameHandlerFunc) Handle(params GetClustersDefaultNameParams) middleware.Responder { - return fn(params) -} - -// GetClustersDefaultNameHandler interface for that can handle valid get clusters default name params -type GetClustersDefaultNameHandler interface { - Handle(GetClustersDefaultNameParams) middleware.Responder -} - -// NewGetClustersDefaultName creates a new http.Handler for the get clusters default name operation -func NewGetClustersDefaultName(ctx *middleware.Context, handler GetClustersDefaultNameHandler) *GetClustersDefaultName { - return &GetClustersDefaultName{Context: ctx, Handler: handler} -} - -/* - GetClustersDefaultName swagger:route GET /clusters/default_name cluster getClustersDefaultName - -Get cluster default name -*/ -type GetClustersDefaultName struct { - Context *middleware.Context - Handler GetClustersDefaultNameHandler -} - -func (o *GetClustersDefaultName) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetClustersDefaultNameParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/get_clusters_default_name_parameters.go b/console/service/restapi/operations/cluster/get_clusters_default_name_parameters.go deleted file mode 100644 index 29eb36284..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_default_name_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetClustersDefaultNameParams creates a new GetClustersDefaultNameParams object -// -// There are no default values defined in the spec. -func NewGetClustersDefaultNameParams() GetClustersDefaultNameParams { - - return GetClustersDefaultNameParams{} -} - -// GetClustersDefaultNameParams contains all the bound params for the get clusters default name operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetClustersDefaultName -type GetClustersDefaultNameParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetClustersDefaultNameParams() beforehand. -func (o *GetClustersDefaultNameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/cluster/get_clusters_default_name_responses.go b/console/service/restapi/operations/cluster/get_clusters_default_name_responses.go deleted file mode 100644 index 7a2dd3e8c..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_default_name_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetClustersDefaultNameOKCode is the HTTP code returned for type GetClustersDefaultNameOK -const GetClustersDefaultNameOKCode int = 200 - -/* -GetClustersDefaultNameOK OK - -swagger:response getClustersDefaultNameOK -*/ -type GetClustersDefaultNameOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterDefaultName `json:"body,omitempty"` -} - -// NewGetClustersDefaultNameOK creates GetClustersDefaultNameOK with default headers values -func NewGetClustersDefaultNameOK() *GetClustersDefaultNameOK { - - return &GetClustersDefaultNameOK{} -} - -// WithPayload adds the payload to the get clusters default name o k response -func (o *GetClustersDefaultNameOK) WithPayload(payload *models.ResponseClusterDefaultName) *GetClustersDefaultNameOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get clusters default name o k response -func (o *GetClustersDefaultNameOK) SetPayload(payload *models.ResponseClusterDefaultName) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClustersDefaultNameOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetClustersDefaultNameBadRequestCode is the HTTP code returned for type GetClustersDefaultNameBadRequest -const GetClustersDefaultNameBadRequestCode int = 400 - -/* -GetClustersDefaultNameBadRequest Error - -swagger:response getClustersDefaultNameBadRequest -*/ -type GetClustersDefaultNameBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetClustersDefaultNameBadRequest creates GetClustersDefaultNameBadRequest with default headers values -func NewGetClustersDefaultNameBadRequest() *GetClustersDefaultNameBadRequest { - - return &GetClustersDefaultNameBadRequest{} -} - -// WithPayload adds the payload to the get clusters default name bad request response -func (o *GetClustersDefaultNameBadRequest) WithPayload(payload *models.ResponseError) *GetClustersDefaultNameBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get clusters default name bad request response -func (o *GetClustersDefaultNameBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClustersDefaultNameBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/get_clusters_default_name_urlbuilder.go b/console/service/restapi/operations/cluster/get_clusters_default_name_urlbuilder.go deleted file mode 100644 index 1ee242a2f..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_default_name_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetClustersDefaultNameURL generates an URL for the get clusters default name operation -type GetClustersDefaultNameURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClustersDefaultNameURL) WithBasePath(bp string) *GetClustersDefaultNameURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClustersDefaultNameURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetClustersDefaultNameURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/default_name" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetClustersDefaultNameURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetClustersDefaultNameURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetClustersDefaultNameURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetClustersDefaultNameURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetClustersDefaultNameURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetClustersDefaultNameURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/get_clusters_id.go b/console/service/restapi/operations/cluster/get_clusters_id.go deleted file mode 100644 index e83806deb..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetClustersIDHandlerFunc turns a function with the right signature into a get clusters ID handler -type GetClustersIDHandlerFunc func(GetClustersIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetClustersIDHandlerFunc) Handle(params GetClustersIDParams) middleware.Responder { - return fn(params) -} - -// GetClustersIDHandler interface for that can handle valid get clusters ID params -type GetClustersIDHandler interface { - Handle(GetClustersIDParams) middleware.Responder -} - -// NewGetClustersID creates a new http.Handler for the get clusters ID operation -func NewGetClustersID(ctx *middleware.Context, handler GetClustersIDHandler) *GetClustersID { - return &GetClustersID{Context: ctx, Handler: handler} -} - -/* - GetClustersID swagger:route GET /clusters/{id} cluster getClustersId - -Get cluster info -*/ -type GetClustersID struct { - Context *middleware.Context - Handler GetClustersIDHandler -} - -func (o *GetClustersID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetClustersIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/get_clusters_id_parameters.go b/console/service/restapi/operations/cluster/get_clusters_id_parameters.go deleted file mode 100644 index d2b206d85..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetClustersIDParams creates a new GetClustersIDParams object -// -// There are no default values defined in the spec. -func NewGetClustersIDParams() GetClustersIDParams { - - return GetClustersIDParams{} -} - -// GetClustersIDParams contains all the bound params for the get clusters ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetClustersID -type GetClustersIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetClustersIDParams() beforehand. -func (o *GetClustersIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetClustersIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/get_clusters_id_responses.go b/console/service/restapi/operations/cluster/get_clusters_id_responses.go deleted file mode 100644 index 518085b8e..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_id_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetClustersIDOKCode is the HTTP code returned for type GetClustersIDOK -const GetClustersIDOKCode int = 200 - -/* -GetClustersIDOK OK - -swagger:response getClustersIdOK -*/ -type GetClustersIDOK struct { - - /* - In: Body - */ - Payload *models.ClusterInfo `json:"body,omitempty"` -} - -// NewGetClustersIDOK creates GetClustersIDOK with default headers values -func NewGetClustersIDOK() *GetClustersIDOK { - - return &GetClustersIDOK{} -} - -// WithPayload adds the payload to the get clusters Id o k response -func (o *GetClustersIDOK) WithPayload(payload *models.ClusterInfo) *GetClustersIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get clusters Id o k response -func (o *GetClustersIDOK) SetPayload(payload *models.ClusterInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClustersIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetClustersIDBadRequestCode is the HTTP code returned for type GetClustersIDBadRequest -const GetClustersIDBadRequestCode int = 400 - -/* -GetClustersIDBadRequest Error - -swagger:response getClustersIdBadRequest -*/ -type GetClustersIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetClustersIDBadRequest creates GetClustersIDBadRequest with default headers values -func NewGetClustersIDBadRequest() *GetClustersIDBadRequest { - - return &GetClustersIDBadRequest{} -} - -// WithPayload adds the payload to the get clusters Id bad request response -func (o *GetClustersIDBadRequest) WithPayload(payload *models.ResponseError) *GetClustersIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get clusters Id bad request response -func (o *GetClustersIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClustersIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/get_clusters_id_urlbuilder.go b/console/service/restapi/operations/cluster/get_clusters_id_urlbuilder.go deleted file mode 100644 index ae9b0c38d..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// GetClustersIDURL generates an URL for the get clusters ID operation -type GetClustersIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClustersIDURL) WithBasePath(bp string) *GetClustersIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClustersIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetClustersIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetClustersIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetClustersIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetClustersIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetClustersIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetClustersIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetClustersIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetClustersIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/get_clusters_parameters.go b/console/service/restapi/operations/cluster/get_clusters_parameters.go deleted file mode 100644 index b53e335ef..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_parameters.go +++ /dev/null @@ -1,455 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetClustersParams creates a new GetClustersParams object -// -// There are no default values defined in the spec. -func NewGetClustersParams() GetClustersParams { - - return GetClustersParams{} -} - -// GetClustersParams contains all the bound params for the get clusters operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetClusters -type GetClustersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Created at after this date - In: query - */ - CreatedAtFrom *strfmt.DateTime - /*Created at till this date - In: query - */ - CreatedAtTo *strfmt.DateTime - /*Filter by environment - In: query - */ - Environment *string - /* - In: query - */ - Limit *int64 - /*Filter by location - In: query - */ - Location *string - /*Filter by name - In: query - */ - Name *string - /* - In: query - */ - Offset *int64 - /*Filter by postgres_version - In: query - */ - PostgresVersion *int64 - /* - Required: true - In: query - */ - ProjectID int64 - /*Filter by server_count - In: query - */ - ServerCount *int64 - /*Sort by fields. Example: sort_by=id,-name,created_at,updated_at - Supported values: - - id - - name - - created_at - - updated_at - - environment - - project - - status - - location - - server_count - - postgres_version - - In: query - */ - SortBy *string - /*Filter by status - In: query - */ - Status *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetClustersParams() beforehand. -func (o *GetClustersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qCreatedAtFrom, qhkCreatedAtFrom, _ := qs.GetOK("created_at_from") - if err := o.bindCreatedAtFrom(qCreatedAtFrom, qhkCreatedAtFrom, route.Formats); err != nil { - res = append(res, err) - } - - qCreatedAtTo, qhkCreatedAtTo, _ := qs.GetOK("created_at_to") - if err := o.bindCreatedAtTo(qCreatedAtTo, qhkCreatedAtTo, route.Formats); err != nil { - res = append(res, err) - } - - qEnvironment, qhkEnvironment, _ := qs.GetOK("environment") - if err := o.bindEnvironment(qEnvironment, qhkEnvironment, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qLocation, qhkLocation, _ := qs.GetOK("location") - if err := o.bindLocation(qLocation, qhkLocation, route.Formats); err != nil { - res = append(res, err) - } - - qName, qhkName, _ := qs.GetOK("name") - if err := o.bindName(qName, qhkName, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qPostgresVersion, qhkPostgresVersion, _ := qs.GetOK("postgres_version") - if err := o.bindPostgresVersion(qPostgresVersion, qhkPostgresVersion, route.Formats); err != nil { - res = append(res, err) - } - - qProjectID, qhkProjectID, _ := qs.GetOK("project_id") - if err := o.bindProjectID(qProjectID, qhkProjectID, route.Formats); err != nil { - res = append(res, err) - } - - qServerCount, qhkServerCount, _ := qs.GetOK("server_count") - if err := o.bindServerCount(qServerCount, qhkServerCount, route.Formats); err != nil { - res = append(res, err) - } - - qSortBy, qhkSortBy, _ := qs.GetOK("sort_by") - if err := o.bindSortBy(qSortBy, qhkSortBy, route.Formats); err != nil { - res = append(res, err) - } - - qStatus, qhkStatus, _ := qs.GetOK("status") - if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindCreatedAtFrom binds and validates parameter CreatedAtFrom from query. -func (o *GetClustersParams) bindCreatedAtFrom(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("created_at_from", "query", "strfmt.DateTime", raw) - } - o.CreatedAtFrom = (value.(*strfmt.DateTime)) - - if err := o.validateCreatedAtFrom(formats); err != nil { - return err - } - - return nil -} - -// validateCreatedAtFrom carries on validations for parameter CreatedAtFrom -func (o *GetClustersParams) validateCreatedAtFrom(formats strfmt.Registry) error { - - if err := validate.FormatOf("created_at_from", "query", "date-time", o.CreatedAtFrom.String(), formats); err != nil { - return err - } - return nil -} - -// bindCreatedAtTo binds and validates parameter CreatedAtTo from query. -func (o *GetClustersParams) bindCreatedAtTo(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("created_at_to", "query", "strfmt.DateTime", raw) - } - o.CreatedAtTo = (value.(*strfmt.DateTime)) - - if err := o.validateCreatedAtTo(formats); err != nil { - return err - } - - return nil -} - -// validateCreatedAtTo carries on validations for parameter CreatedAtTo -func (o *GetClustersParams) validateCreatedAtTo(formats strfmt.Registry) error { - - if err := validate.FormatOf("created_at_to", "query", "date-time", o.CreatedAtTo.String(), formats); err != nil { - return err - } - return nil -} - -// bindEnvironment binds and validates parameter Environment from query. -func (o *GetClustersParams) bindEnvironment(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Environment = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetClustersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindLocation binds and validates parameter Location from query. -func (o *GetClustersParams) bindLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Location = &raw - - return nil -} - -// bindName binds and validates parameter Name from query. -func (o *GetClustersParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Name = &raw - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetClustersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindPostgresVersion binds and validates parameter PostgresVersion from query. -func (o *GetClustersParams) bindPostgresVersion(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("postgres_version", "query", "int64", raw) - } - o.PostgresVersion = &value - - return nil -} - -// bindProjectID binds and validates parameter ProjectID from query. -func (o *GetClustersParams) bindProjectID(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("project_id", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("project_id", "query", raw); err != nil { - return err - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("project_id", "query", "int64", raw) - } - o.ProjectID = value - - return nil -} - -// bindServerCount binds and validates parameter ServerCount from query. -func (o *GetClustersParams) bindServerCount(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("server_count", "query", "int64", raw) - } - o.ServerCount = &value - - return nil -} - -// bindSortBy binds and validates parameter SortBy from query. -func (o *GetClustersParams) bindSortBy(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.SortBy = &raw - - return nil -} - -// bindStatus binds and validates parameter Status from query. -func (o *GetClustersParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Status = &raw - - return nil -} diff --git a/console/service/restapi/operations/cluster/get_clusters_responses.go b/console/service/restapi/operations/cluster/get_clusters_responses.go deleted file mode 100644 index a96a1352d..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetClustersOKCode is the HTTP code returned for type GetClustersOK -const GetClustersOKCode int = 200 - -/* -GetClustersOK OK - -swagger:response getClustersOK -*/ -type GetClustersOK struct { - - /* - In: Body - */ - Payload *models.ResponseClustersInfo `json:"body,omitempty"` -} - -// NewGetClustersOK creates GetClustersOK with default headers values -func NewGetClustersOK() *GetClustersOK { - - return &GetClustersOK{} -} - -// WithPayload adds the payload to the get clusters o k response -func (o *GetClustersOK) WithPayload(payload *models.ResponseClustersInfo) *GetClustersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get clusters o k response -func (o *GetClustersOK) SetPayload(payload *models.ResponseClustersInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClustersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetClustersBadRequestCode is the HTTP code returned for type GetClustersBadRequest -const GetClustersBadRequestCode int = 400 - -/* -GetClustersBadRequest Error - -swagger:response getClustersBadRequest -*/ -type GetClustersBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetClustersBadRequest creates GetClustersBadRequest with default headers values -func NewGetClustersBadRequest() *GetClustersBadRequest { - - return &GetClustersBadRequest{} -} - -// WithPayload adds the payload to the get clusters bad request response -func (o *GetClustersBadRequest) WithPayload(payload *models.ResponseError) *GetClustersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get clusters bad request response -func (o *GetClustersBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClustersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/get_clusters_urlbuilder.go b/console/service/restapi/operations/cluster/get_clusters_urlbuilder.go deleted file mode 100644 index c8cc4d83d..000000000 --- a/console/service/restapi/operations/cluster/get_clusters_urlbuilder.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetClustersURL generates an URL for the get clusters operation -type GetClustersURL struct { - CreatedAtFrom *strfmt.DateTime - CreatedAtTo *strfmt.DateTime - Environment *string - Limit *int64 - Location *string - Name *string - Offset *int64 - PostgresVersion *int64 - ProjectID int64 - ServerCount *int64 - SortBy *string - Status *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClustersURL) WithBasePath(bp string) *GetClustersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClustersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetClustersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var createdAtFromQ string - if o.CreatedAtFrom != nil { - createdAtFromQ = o.CreatedAtFrom.String() - } - if createdAtFromQ != "" { - qs.Set("created_at_from", createdAtFromQ) - } - - var createdAtToQ string - if o.CreatedAtTo != nil { - createdAtToQ = o.CreatedAtTo.String() - } - if createdAtToQ != "" { - qs.Set("created_at_to", createdAtToQ) - } - - var environmentQ string - if o.Environment != nil { - environmentQ = *o.Environment - } - if environmentQ != "" { - qs.Set("environment", environmentQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var locationQ string - if o.Location != nil { - locationQ = *o.Location - } - if locationQ != "" { - qs.Set("location", locationQ) - } - - var nameQ string - if o.Name != nil { - nameQ = *o.Name - } - if nameQ != "" { - qs.Set("name", nameQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var postgresVersionQ string - if o.PostgresVersion != nil { - postgresVersionQ = swag.FormatInt64(*o.PostgresVersion) - } - if postgresVersionQ != "" { - qs.Set("postgres_version", postgresVersionQ) - } - - projectIDQ := swag.FormatInt64(o.ProjectID) - if projectIDQ != "" { - qs.Set("project_id", projectIDQ) - } - - var serverCountQ string - if o.ServerCount != nil { - serverCountQ = swag.FormatInt64(*o.ServerCount) - } - if serverCountQ != "" { - qs.Set("server_count", serverCountQ) - } - - var sortByQ string - if o.SortBy != nil { - sortByQ = *o.SortBy - } - if sortByQ != "" { - qs.Set("sort_by", sortByQ) - } - - var statusQ string - if o.Status != nil { - statusQ = *o.Status - } - if statusQ != "" { - qs.Set("status", statusQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetClustersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetClustersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetClustersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetClustersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetClustersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetClustersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters.go b/console/service/restapi/operations/cluster/post_clusters.go deleted file mode 100644 index f3ce7808a..000000000 --- a/console/service/restapi/operations/cluster/post_clusters.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersHandlerFunc turns a function with the right signature into a post clusters handler -type PostClustersHandlerFunc func(PostClustersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersHandlerFunc) Handle(params PostClustersParams) middleware.Responder { - return fn(params) -} - -// PostClustersHandler interface for that can handle valid post clusters params -type PostClustersHandler interface { - Handle(PostClustersParams) middleware.Responder -} - -// NewPostClusters creates a new http.Handler for the post clusters operation -func NewPostClusters(ctx *middleware.Context, handler PostClustersHandler) *PostClusters { - return &PostClusters{Context: ctx, Handler: handler} -} - -/* - PostClusters swagger:route POST /clusters cluster postClusters - -Create new cluster -*/ -type PostClusters struct { - Context *middleware.Context - Handler PostClustersHandler -} - -func (o *PostClusters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_refresh.go b/console/service/restapi/operations/cluster/post_clusters_id_refresh.go deleted file mode 100644 index 994b4ed93..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_refresh.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDRefreshHandlerFunc turns a function with the right signature into a post clusters ID refresh handler -type PostClustersIDRefreshHandlerFunc func(PostClustersIDRefreshParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDRefreshHandlerFunc) Handle(params PostClustersIDRefreshParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDRefreshHandler interface for that can handle valid post clusters ID refresh params -type PostClustersIDRefreshHandler interface { - Handle(PostClustersIDRefreshParams) middleware.Responder -} - -// NewPostClustersIDRefresh creates a new http.Handler for the post clusters ID refresh operation -func NewPostClustersIDRefresh(ctx *middleware.Context, handler PostClustersIDRefreshHandler) *PostClustersIDRefresh { - return &PostClustersIDRefresh{Context: ctx, Handler: handler} -} - -/* - PostClustersIDRefresh swagger:route POST /clusters/{id}/refresh cluster postClustersIdRefresh - -Refresh cluster info -*/ -type PostClustersIDRefresh struct { - Context *middleware.Context - Handler PostClustersIDRefreshHandler -} - -func (o *PostClustersIDRefresh) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDRefreshParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_refresh_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_refresh_parameters.go deleted file mode 100644 index fd8c54d2d..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_refresh_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewPostClustersIDRefreshParams creates a new PostClustersIDRefreshParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDRefreshParams() PostClustersIDRefreshParams { - - return PostClustersIDRefreshParams{} -} - -// PostClustersIDRefreshParams contains all the bound params for the post clusters ID refresh operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDRefresh -type PostClustersIDRefreshParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDRefreshParams() beforehand. -func (o *PostClustersIDRefreshParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDRefreshParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_refresh_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_refresh_responses.go deleted file mode 100644 index d79ac9495..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_refresh_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDRefreshOKCode is the HTTP code returned for type PostClustersIDRefreshOK -const PostClustersIDRefreshOKCode int = 200 - -/* -PostClustersIDRefreshOK OK - -swagger:response postClustersIdRefreshOK -*/ -type PostClustersIDRefreshOK struct { - - /* - In: Body - */ - Payload *models.ClusterInfo `json:"body,omitempty"` -} - -// NewPostClustersIDRefreshOK creates PostClustersIDRefreshOK with default headers values -func NewPostClustersIDRefreshOK() *PostClustersIDRefreshOK { - - return &PostClustersIDRefreshOK{} -} - -// WithPayload adds the payload to the post clusters Id refresh o k response -func (o *PostClustersIDRefreshOK) WithPayload(payload *models.ClusterInfo) *PostClustersIDRefreshOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id refresh o k response -func (o *PostClustersIDRefreshOK) SetPayload(payload *models.ClusterInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDRefreshOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersIDRefreshBadRequestCode is the HTTP code returned for type PostClustersIDRefreshBadRequest -const PostClustersIDRefreshBadRequestCode int = 400 - -/* -PostClustersIDRefreshBadRequest Error - -swagger:response postClustersIdRefreshBadRequest -*/ -type PostClustersIDRefreshBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDRefreshBadRequest creates PostClustersIDRefreshBadRequest with default headers values -func NewPostClustersIDRefreshBadRequest() *PostClustersIDRefreshBadRequest { - - return &PostClustersIDRefreshBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id refresh bad request response -func (o *PostClustersIDRefreshBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDRefreshBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id refresh bad request response -func (o *PostClustersIDRefreshBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDRefreshBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_refresh_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_refresh_urlbuilder.go deleted file mode 100644 index bdd294411..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_refresh_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDRefreshURL generates an URL for the post clusters ID refresh operation -type PostClustersIDRefreshURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDRefreshURL) WithBasePath(bp string) *PostClustersIDRefreshURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDRefreshURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDRefreshURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/refresh" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDRefreshURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDRefreshURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDRefreshURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDRefreshURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDRefreshURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDRefreshURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDRefreshURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reinit.go b/console/service/restapi/operations/cluster/post_clusters_id_reinit.go deleted file mode 100644 index a0947aa32..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reinit.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDReinitHandlerFunc turns a function with the right signature into a post clusters ID reinit handler -type PostClustersIDReinitHandlerFunc func(PostClustersIDReinitParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDReinitHandlerFunc) Handle(params PostClustersIDReinitParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDReinitHandler interface for that can handle valid post clusters ID reinit params -type PostClustersIDReinitHandler interface { - Handle(PostClustersIDReinitParams) middleware.Responder -} - -// NewPostClustersIDReinit creates a new http.Handler for the post clusters ID reinit operation -func NewPostClustersIDReinit(ctx *middleware.Context, handler PostClustersIDReinitHandler) *PostClustersIDReinit { - return &PostClustersIDReinit{Context: ctx, Handler: handler} -} - -/* - PostClustersIDReinit swagger:route POST /clusters/{id}/reinit cluster postClustersIdReinit - -Reinit cluster -*/ -type PostClustersIDReinit struct { - Context *middleware.Context - Handler PostClustersIDReinitHandler -} - -func (o *PostClustersIDReinit) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDReinitParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reinit_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_reinit_parameters.go deleted file mode 100644 index 4b26474f9..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reinit_parameters.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// NewPostClustersIDReinitParams creates a new PostClustersIDReinitParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDReinitParams() PostClustersIDReinitParams { - - return PostClustersIDReinitParams{} -} - -// PostClustersIDReinitParams contains all the bound params for the post clusters ID reinit operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDReinit -type PostClustersIDReinitParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body models.RequestClusterReinit - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDReinitParams() beforehand. -func (o *PostClustersIDReinitParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterReinit - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // no validation on generic interface - o.Body = body - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDReinitParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reinit_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_reinit_responses.go deleted file mode 100644 index a0647d90d..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reinit_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDReinitOKCode is the HTTP code returned for type PostClustersIDReinitOK -const PostClustersIDReinitOKCode int = 200 - -/* -PostClustersIDReinitOK OK - -swagger:response postClustersIdReinitOK -*/ -type PostClustersIDReinitOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterCreate `json:"body,omitempty"` -} - -// NewPostClustersIDReinitOK creates PostClustersIDReinitOK with default headers values -func NewPostClustersIDReinitOK() *PostClustersIDReinitOK { - - return &PostClustersIDReinitOK{} -} - -// WithPayload adds the payload to the post clusters Id reinit o k response -func (o *PostClustersIDReinitOK) WithPayload(payload *models.ResponseClusterCreate) *PostClustersIDReinitOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id reinit o k response -func (o *PostClustersIDReinitOK) SetPayload(payload *models.ResponseClusterCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDReinitOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersIDReinitBadRequestCode is the HTTP code returned for type PostClustersIDReinitBadRequest -const PostClustersIDReinitBadRequestCode int = 400 - -/* -PostClustersIDReinitBadRequest Error - -swagger:response postClustersIdReinitBadRequest -*/ -type PostClustersIDReinitBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDReinitBadRequest creates PostClustersIDReinitBadRequest with default headers values -func NewPostClustersIDReinitBadRequest() *PostClustersIDReinitBadRequest { - - return &PostClustersIDReinitBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id reinit bad request response -func (o *PostClustersIDReinitBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDReinitBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id reinit bad request response -func (o *PostClustersIDReinitBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDReinitBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reinit_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_reinit_urlbuilder.go deleted file mode 100644 index a522a85ce..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reinit_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDReinitURL generates an URL for the post clusters ID reinit operation -type PostClustersIDReinitURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDReinitURL) WithBasePath(bp string) *PostClustersIDReinitURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDReinitURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDReinitURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/reinit" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDReinitURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDReinitURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDReinitURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDReinitURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDReinitURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDReinitURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDReinitURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reload.go b/console/service/restapi/operations/cluster/post_clusters_id_reload.go deleted file mode 100644 index 9de7282ad..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reload.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDReloadHandlerFunc turns a function with the right signature into a post clusters ID reload handler -type PostClustersIDReloadHandlerFunc func(PostClustersIDReloadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDReloadHandlerFunc) Handle(params PostClustersIDReloadParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDReloadHandler interface for that can handle valid post clusters ID reload params -type PostClustersIDReloadHandler interface { - Handle(PostClustersIDReloadParams) middleware.Responder -} - -// NewPostClustersIDReload creates a new http.Handler for the post clusters ID reload operation -func NewPostClustersIDReload(ctx *middleware.Context, handler PostClustersIDReloadHandler) *PostClustersIDReload { - return &PostClustersIDReload{Context: ctx, Handler: handler} -} - -/* - PostClustersIDReload swagger:route POST /clusters/{id}/reload cluster postClustersIdReload - -Reload cluster -*/ -type PostClustersIDReload struct { - Context *middleware.Context - Handler PostClustersIDReloadHandler -} - -func (o *PostClustersIDReload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDReloadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reload_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_reload_parameters.go deleted file mode 100644 index 5b42b9c46..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reload_parameters.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// NewPostClustersIDReloadParams creates a new PostClustersIDReloadParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDReloadParams() PostClustersIDReloadParams { - - return PostClustersIDReloadParams{} -} - -// PostClustersIDReloadParams contains all the bound params for the post clusters ID reload operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDReload -type PostClustersIDReloadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body models.RequestClusterReload - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDReloadParams() beforehand. -func (o *PostClustersIDReloadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterReload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // no validation on generic interface - o.Body = body - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDReloadParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reload_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_reload_responses.go deleted file mode 100644 index bc09e9e21..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reload_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDReloadOKCode is the HTTP code returned for type PostClustersIDReloadOK -const PostClustersIDReloadOKCode int = 200 - -/* -PostClustersIDReloadOK OK - -swagger:response postClustersIdReloadOK -*/ -type PostClustersIDReloadOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterCreate `json:"body,omitempty"` -} - -// NewPostClustersIDReloadOK creates PostClustersIDReloadOK with default headers values -func NewPostClustersIDReloadOK() *PostClustersIDReloadOK { - - return &PostClustersIDReloadOK{} -} - -// WithPayload adds the payload to the post clusters Id reload o k response -func (o *PostClustersIDReloadOK) WithPayload(payload *models.ResponseClusterCreate) *PostClustersIDReloadOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id reload o k response -func (o *PostClustersIDReloadOK) SetPayload(payload *models.ResponseClusterCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDReloadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersIDReloadBadRequestCode is the HTTP code returned for type PostClustersIDReloadBadRequest -const PostClustersIDReloadBadRequestCode int = 400 - -/* -PostClustersIDReloadBadRequest Error - -swagger:response postClustersIdReloadBadRequest -*/ -type PostClustersIDReloadBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDReloadBadRequest creates PostClustersIDReloadBadRequest with default headers values -func NewPostClustersIDReloadBadRequest() *PostClustersIDReloadBadRequest { - - return &PostClustersIDReloadBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id reload bad request response -func (o *PostClustersIDReloadBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDReloadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id reload bad request response -func (o *PostClustersIDReloadBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDReloadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_reload_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_reload_urlbuilder.go deleted file mode 100644 index bed96c058..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_reload_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDReloadURL generates an URL for the post clusters ID reload operation -type PostClustersIDReloadURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDReloadURL) WithBasePath(bp string) *PostClustersIDReloadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDReloadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDReloadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/reload" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDReloadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDReloadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDReloadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDReloadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDReloadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDReloadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDReloadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_remove.go b/console/service/restapi/operations/cluster/post_clusters_id_remove.go deleted file mode 100644 index 147528fe4..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_remove.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDRemoveHandlerFunc turns a function with the right signature into a post clusters ID remove handler -type PostClustersIDRemoveHandlerFunc func(PostClustersIDRemoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDRemoveHandlerFunc) Handle(params PostClustersIDRemoveParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDRemoveHandler interface for that can handle valid post clusters ID remove params -type PostClustersIDRemoveHandler interface { - Handle(PostClustersIDRemoveParams) middleware.Responder -} - -// NewPostClustersIDRemove creates a new http.Handler for the post clusters ID remove operation -func NewPostClustersIDRemove(ctx *middleware.Context, handler PostClustersIDRemoveHandler) *PostClustersIDRemove { - return &PostClustersIDRemove{Context: ctx, Handler: handler} -} - -/* - PostClustersIDRemove swagger:route POST /clusters/{id}/remove cluster postClustersIdRemove - -Remove cluster -*/ -type PostClustersIDRemove struct { - Context *middleware.Context - Handler PostClustersIDRemoveHandler -} - -func (o *PostClustersIDRemove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDRemoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_remove_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_remove_parameters.go deleted file mode 100644 index c15cdc122..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_remove_parameters.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// NewPostClustersIDRemoveParams creates a new PostClustersIDRemoveParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDRemoveParams() PostClustersIDRemoveParams { - - return PostClustersIDRemoveParams{} -} - -// PostClustersIDRemoveParams contains all the bound params for the post clusters ID remove operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDRemove -type PostClustersIDRemoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body models.RequestClusterRemove - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDRemoveParams() beforehand. -func (o *PostClustersIDRemoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterRemove - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // no validation on generic interface - o.Body = body - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDRemoveParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_remove_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_remove_responses.go deleted file mode 100644 index cb659290d..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_remove_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDRemoveNoContentCode is the HTTP code returned for type PostClustersIDRemoveNoContent -const PostClustersIDRemoveNoContentCode int = 204 - -/* -PostClustersIDRemoveNoContent OK - -swagger:response postClustersIdRemoveNoContent -*/ -type PostClustersIDRemoveNoContent struct { -} - -// NewPostClustersIDRemoveNoContent creates PostClustersIDRemoveNoContent with default headers values -func NewPostClustersIDRemoveNoContent() *PostClustersIDRemoveNoContent { - - return &PostClustersIDRemoveNoContent{} -} - -// WriteResponse to the client -func (o *PostClustersIDRemoveNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// PostClustersIDRemoveBadRequestCode is the HTTP code returned for type PostClustersIDRemoveBadRequest -const PostClustersIDRemoveBadRequestCode int = 400 - -/* -PostClustersIDRemoveBadRequest Error - -swagger:response postClustersIdRemoveBadRequest -*/ -type PostClustersIDRemoveBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDRemoveBadRequest creates PostClustersIDRemoveBadRequest with default headers values -func NewPostClustersIDRemoveBadRequest() *PostClustersIDRemoveBadRequest { - - return &PostClustersIDRemoveBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id remove bad request response -func (o *PostClustersIDRemoveBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDRemoveBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id remove bad request response -func (o *PostClustersIDRemoveBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDRemoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_remove_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_remove_urlbuilder.go deleted file mode 100644 index 3688dbb60..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_remove_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDRemoveURL generates an URL for the post clusters ID remove operation -type PostClustersIDRemoveURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDRemoveURL) WithBasePath(bp string) *PostClustersIDRemoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDRemoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDRemoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/remove" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDRemoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDRemoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDRemoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDRemoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDRemoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDRemoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDRemoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_restart.go b/console/service/restapi/operations/cluster/post_clusters_id_restart.go deleted file mode 100644 index 405fd5ecb..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_restart.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDRestartHandlerFunc turns a function with the right signature into a post clusters ID restart handler -type PostClustersIDRestartHandlerFunc func(PostClustersIDRestartParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDRestartHandlerFunc) Handle(params PostClustersIDRestartParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDRestartHandler interface for that can handle valid post clusters ID restart params -type PostClustersIDRestartHandler interface { - Handle(PostClustersIDRestartParams) middleware.Responder -} - -// NewPostClustersIDRestart creates a new http.Handler for the post clusters ID restart operation -func NewPostClustersIDRestart(ctx *middleware.Context, handler PostClustersIDRestartHandler) *PostClustersIDRestart { - return &PostClustersIDRestart{Context: ctx, Handler: handler} -} - -/* - PostClustersIDRestart swagger:route POST /clusters/{id}/restart cluster postClustersIdRestart - -Restart cluster -*/ -type PostClustersIDRestart struct { - Context *middleware.Context - Handler PostClustersIDRestartHandler -} - -func (o *PostClustersIDRestart) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDRestartParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_restart_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_restart_parameters.go deleted file mode 100644 index 843f42410..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_restart_parameters.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// NewPostClustersIDRestartParams creates a new PostClustersIDRestartParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDRestartParams() PostClustersIDRestartParams { - - return PostClustersIDRestartParams{} -} - -// PostClustersIDRestartParams contains all the bound params for the post clusters ID restart operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDRestart -type PostClustersIDRestartParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body models.RequestClusterRestart - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDRestartParams() beforehand. -func (o *PostClustersIDRestartParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterRestart - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // no validation on generic interface - o.Body = body - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDRestartParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_restart_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_restart_responses.go deleted file mode 100644 index d50ba3a08..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_restart_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDRestartOKCode is the HTTP code returned for type PostClustersIDRestartOK -const PostClustersIDRestartOKCode int = 200 - -/* -PostClustersIDRestartOK OK - -swagger:response postClustersIdRestartOK -*/ -type PostClustersIDRestartOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterCreate `json:"body,omitempty"` -} - -// NewPostClustersIDRestartOK creates PostClustersIDRestartOK with default headers values -func NewPostClustersIDRestartOK() *PostClustersIDRestartOK { - - return &PostClustersIDRestartOK{} -} - -// WithPayload adds the payload to the post clusters Id restart o k response -func (o *PostClustersIDRestartOK) WithPayload(payload *models.ResponseClusterCreate) *PostClustersIDRestartOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id restart o k response -func (o *PostClustersIDRestartOK) SetPayload(payload *models.ResponseClusterCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDRestartOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersIDRestartBadRequestCode is the HTTP code returned for type PostClustersIDRestartBadRequest -const PostClustersIDRestartBadRequestCode int = 400 - -/* -PostClustersIDRestartBadRequest Error - -swagger:response postClustersIdRestartBadRequest -*/ -type PostClustersIDRestartBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDRestartBadRequest creates PostClustersIDRestartBadRequest with default headers values -func NewPostClustersIDRestartBadRequest() *PostClustersIDRestartBadRequest { - - return &PostClustersIDRestartBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id restart bad request response -func (o *PostClustersIDRestartBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDRestartBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id restart bad request response -func (o *PostClustersIDRestartBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDRestartBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_restart_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_restart_urlbuilder.go deleted file mode 100644 index fae9b14ab..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_restart_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDRestartURL generates an URL for the post clusters ID restart operation -type PostClustersIDRestartURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDRestartURL) WithBasePath(bp string) *PostClustersIDRestartURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDRestartURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDRestartURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/restart" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDRestartURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDRestartURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDRestartURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDRestartURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDRestartURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDRestartURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDRestartURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_start.go b/console/service/restapi/operations/cluster/post_clusters_id_start.go deleted file mode 100644 index ff3adf033..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_start.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDStartHandlerFunc turns a function with the right signature into a post clusters ID start handler -type PostClustersIDStartHandlerFunc func(PostClustersIDStartParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDStartHandlerFunc) Handle(params PostClustersIDStartParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDStartHandler interface for that can handle valid post clusters ID start params -type PostClustersIDStartHandler interface { - Handle(PostClustersIDStartParams) middleware.Responder -} - -// NewPostClustersIDStart creates a new http.Handler for the post clusters ID start operation -func NewPostClustersIDStart(ctx *middleware.Context, handler PostClustersIDStartHandler) *PostClustersIDStart { - return &PostClustersIDStart{Context: ctx, Handler: handler} -} - -/* - PostClustersIDStart swagger:route POST /clusters/{id}/start cluster postClustersIdStart - -Start cluster -*/ -type PostClustersIDStart struct { - Context *middleware.Context - Handler PostClustersIDStartHandler -} - -func (o *PostClustersIDStart) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDStartParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_start_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_start_parameters.go deleted file mode 100644 index aa477070e..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_start_parameters.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// NewPostClustersIDStartParams creates a new PostClustersIDStartParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDStartParams() PostClustersIDStartParams { - - return PostClustersIDStartParams{} -} - -// PostClustersIDStartParams contains all the bound params for the post clusters ID start operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDStart -type PostClustersIDStartParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body models.RequestClusterStart - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDStartParams() beforehand. -func (o *PostClustersIDStartParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterStart - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // no validation on generic interface - o.Body = body - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDStartParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_start_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_start_responses.go deleted file mode 100644 index 7d3a6105d..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_start_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDStartOKCode is the HTTP code returned for type PostClustersIDStartOK -const PostClustersIDStartOKCode int = 200 - -/* -PostClustersIDStartOK OK - -swagger:response postClustersIdStartOK -*/ -type PostClustersIDStartOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterCreate `json:"body,omitempty"` -} - -// NewPostClustersIDStartOK creates PostClustersIDStartOK with default headers values -func NewPostClustersIDStartOK() *PostClustersIDStartOK { - - return &PostClustersIDStartOK{} -} - -// WithPayload adds the payload to the post clusters Id start o k response -func (o *PostClustersIDStartOK) WithPayload(payload *models.ResponseClusterCreate) *PostClustersIDStartOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id start o k response -func (o *PostClustersIDStartOK) SetPayload(payload *models.ResponseClusterCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDStartOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersIDStartBadRequestCode is the HTTP code returned for type PostClustersIDStartBadRequest -const PostClustersIDStartBadRequestCode int = 400 - -/* -PostClustersIDStartBadRequest Error - -swagger:response postClustersIdStartBadRequest -*/ -type PostClustersIDStartBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDStartBadRequest creates PostClustersIDStartBadRequest with default headers values -func NewPostClustersIDStartBadRequest() *PostClustersIDStartBadRequest { - - return &PostClustersIDStartBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id start bad request response -func (o *PostClustersIDStartBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDStartBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id start bad request response -func (o *PostClustersIDStartBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDStartBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_start_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_start_urlbuilder.go deleted file mode 100644 index 96efd6fed..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_start_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDStartURL generates an URL for the post clusters ID start operation -type PostClustersIDStartURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDStartURL) WithBasePath(bp string) *PostClustersIDStartURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDStartURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDStartURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/start" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDStartURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDStartURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDStartURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDStartURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDStartURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDStartURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDStartURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_stop.go b/console/service/restapi/operations/cluster/post_clusters_id_stop.go deleted file mode 100644 index 2a94cd3d9..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_stop.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostClustersIDStopHandlerFunc turns a function with the right signature into a post clusters ID stop handler -type PostClustersIDStopHandlerFunc func(PostClustersIDStopParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostClustersIDStopHandlerFunc) Handle(params PostClustersIDStopParams) middleware.Responder { - return fn(params) -} - -// PostClustersIDStopHandler interface for that can handle valid post clusters ID stop params -type PostClustersIDStopHandler interface { - Handle(PostClustersIDStopParams) middleware.Responder -} - -// NewPostClustersIDStop creates a new http.Handler for the post clusters ID stop operation -func NewPostClustersIDStop(ctx *middleware.Context, handler PostClustersIDStopHandler) *PostClustersIDStop { - return &PostClustersIDStop{Context: ctx, Handler: handler} -} - -/* - PostClustersIDStop swagger:route POST /clusters/{id}/stop cluster postClustersIdStop - -Stop cluster -*/ -type PostClustersIDStop struct { - Context *middleware.Context - Handler PostClustersIDStopHandler -} - -func (o *PostClustersIDStop) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostClustersIDStopParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_stop_parameters.go b/console/service/restapi/operations/cluster/post_clusters_id_stop_parameters.go deleted file mode 100644 index 814b9ecb1..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_stop_parameters.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// NewPostClustersIDStopParams creates a new PostClustersIDStopParams object -// -// There are no default values defined in the spec. -func NewPostClustersIDStopParams() PostClustersIDStopParams { - - return PostClustersIDStopParams{} -} - -// PostClustersIDStopParams contains all the bound params for the post clusters ID stop operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClustersIDStop -type PostClustersIDStopParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body models.RequestClusterStop - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersIDStopParams() beforehand. -func (o *PostClustersIDStopParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterStop - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // no validation on generic interface - o.Body = body - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PostClustersIDStopParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_stop_responses.go b/console/service/restapi/operations/cluster/post_clusters_id_stop_responses.go deleted file mode 100644 index 204fd9675..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_stop_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersIDStopOKCode is the HTTP code returned for type PostClustersIDStopOK -const PostClustersIDStopOKCode int = 200 - -/* -PostClustersIDStopOK OK - -swagger:response postClustersIdStopOK -*/ -type PostClustersIDStopOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterCreate `json:"body,omitempty"` -} - -// NewPostClustersIDStopOK creates PostClustersIDStopOK with default headers values -func NewPostClustersIDStopOK() *PostClustersIDStopOK { - - return &PostClustersIDStopOK{} -} - -// WithPayload adds the payload to the post clusters Id stop o k response -func (o *PostClustersIDStopOK) WithPayload(payload *models.ResponseClusterCreate) *PostClustersIDStopOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id stop o k response -func (o *PostClustersIDStopOK) SetPayload(payload *models.ResponseClusterCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDStopOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersIDStopBadRequestCode is the HTTP code returned for type PostClustersIDStopBadRequest -const PostClustersIDStopBadRequestCode int = 400 - -/* -PostClustersIDStopBadRequest Error - -swagger:response postClustersIdStopBadRequest -*/ -type PostClustersIDStopBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersIDStopBadRequest creates PostClustersIDStopBadRequest with default headers values -func NewPostClustersIDStopBadRequest() *PostClustersIDStopBadRequest { - - return &PostClustersIDStopBadRequest{} -} - -// WithPayload adds the payload to the post clusters Id stop bad request response -func (o *PostClustersIDStopBadRequest) WithPayload(payload *models.ResponseError) *PostClustersIDStopBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters Id stop bad request response -func (o *PostClustersIDStopBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersIDStopBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_id_stop_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_id_stop_urlbuilder.go deleted file mode 100644 index aaabb6fc1..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_id_stop_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostClustersIDStopURL generates an URL for the post clusters ID stop operation -type PostClustersIDStopURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDStopURL) WithBasePath(bp string) *PostClustersIDStopURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersIDStopURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersIDStopURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters/{id}/stop" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PostClustersIDStopURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersIDStopURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersIDStopURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersIDStopURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersIDStopURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersIDStopURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersIDStopURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/cluster/post_clusters_parameters.go b/console/service/restapi/operations/cluster/post_clusters_parameters.go deleted file mode 100644 index 6db1a8e17..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPostClustersParams creates a new PostClustersParams object -// -// There are no default values defined in the spec. -func NewPostClustersParams() PostClustersParams { - - return PostClustersParams{} -} - -// PostClustersParams contains all the bound params for the post clusters operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostClusters -type PostClustersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestClusterCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostClustersParams() beforehand. -func (o *PostClustersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestClusterCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/cluster/post_clusters_responses.go b/console/service/restapi/operations/cluster/post_clusters_responses.go deleted file mode 100644 index 57c05aa8b..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostClustersOKCode is the HTTP code returned for type PostClustersOK -const PostClustersOKCode int = 200 - -/* -PostClustersOK OK - -swagger:response postClustersOK -*/ -type PostClustersOK struct { - - /* - In: Body - */ - Payload *models.ResponseClusterCreate `json:"body,omitempty"` -} - -// NewPostClustersOK creates PostClustersOK with default headers values -func NewPostClustersOK() *PostClustersOK { - - return &PostClustersOK{} -} - -// WithPayload adds the payload to the post clusters o k response -func (o *PostClustersOK) WithPayload(payload *models.ResponseClusterCreate) *PostClustersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters o k response -func (o *PostClustersOK) SetPayload(payload *models.ResponseClusterCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostClustersBadRequestCode is the HTTP code returned for type PostClustersBadRequest -const PostClustersBadRequestCode int = 400 - -/* -PostClustersBadRequest Error - -swagger:response postClustersBadRequest -*/ -type PostClustersBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostClustersBadRequest creates PostClustersBadRequest with default headers values -func NewPostClustersBadRequest() *PostClustersBadRequest { - - return &PostClustersBadRequest{} -} - -// WithPayload adds the payload to the post clusters bad request response -func (o *PostClustersBadRequest) WithPayload(payload *models.ResponseError) *PostClustersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post clusters bad request response -func (o *PostClustersBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostClustersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/cluster/post_clusters_urlbuilder.go b/console/service/restapi/operations/cluster/post_clusters_urlbuilder.go deleted file mode 100644 index 072ae3210..000000000 --- a/console/service/restapi/operations/cluster/post_clusters_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package cluster - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostClustersURL generates an URL for the post clusters operation -type PostClustersURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersURL) WithBasePath(bp string) *PostClustersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostClustersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostClustersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/clusters" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostClustersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostClustersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostClustersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostClustersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostClustersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostClustersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/dictionary/get_database_extensions.go b/console/service/restapi/operations/dictionary/get_database_extensions.go deleted file mode 100644 index 9985a5a78..000000000 --- a/console/service/restapi/operations/dictionary/get_database_extensions.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetDatabaseExtensionsHandlerFunc turns a function with the right signature into a get database extensions handler -type GetDatabaseExtensionsHandlerFunc func(GetDatabaseExtensionsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetDatabaseExtensionsHandlerFunc) Handle(params GetDatabaseExtensionsParams) middleware.Responder { - return fn(params) -} - -// GetDatabaseExtensionsHandler interface for that can handle valid get database extensions params -type GetDatabaseExtensionsHandler interface { - Handle(GetDatabaseExtensionsParams) middleware.Responder -} - -// NewGetDatabaseExtensions creates a new http.Handler for the get database extensions operation -func NewGetDatabaseExtensions(ctx *middleware.Context, handler GetDatabaseExtensionsHandler) *GetDatabaseExtensions { - return &GetDatabaseExtensions{Context: ctx, Handler: handler} -} - -/* - GetDatabaseExtensions swagger:route GET /database/extensions dictionary getDatabaseExtensions - -Info about available database extensions -*/ -type GetDatabaseExtensions struct { - Context *middleware.Context - Handler GetDatabaseExtensionsHandler -} - -func (o *GetDatabaseExtensions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetDatabaseExtensionsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/dictionary/get_database_extensions_parameters.go b/console/service/restapi/operations/dictionary/get_database_extensions_parameters.go deleted file mode 100644 index 251902ec3..000000000 --- a/console/service/restapi/operations/dictionary/get_database_extensions_parameters.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetDatabaseExtensionsParams creates a new GetDatabaseExtensionsParams object -// with the default values initialized. -func NewGetDatabaseExtensionsParams() GetDatabaseExtensionsParams { - - var ( - // initialize parameters with default values - - extensionTypeDefault = string("all") - ) - - return GetDatabaseExtensionsParams{ - ExtensionType: &extensionTypeDefault, - } -} - -// GetDatabaseExtensionsParams contains all the bound params for the get database extensions operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetDatabaseExtensions -type GetDatabaseExtensionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - Default: "all" - */ - ExtensionType *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /* - In: query - */ - PostgresVersion *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetDatabaseExtensionsParams() beforehand. -func (o *GetDatabaseExtensionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qExtensionType, qhkExtensionType, _ := qs.GetOK("extension_type") - if err := o.bindExtensionType(qExtensionType, qhkExtensionType, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qPostgresVersion, qhkPostgresVersion, _ := qs.GetOK("postgres_version") - if err := o.bindPostgresVersion(qPostgresVersion, qhkPostgresVersion, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindExtensionType binds and validates parameter ExtensionType from query. -func (o *GetDatabaseExtensionsParams) bindExtensionType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - // Default values have been previously initialized by NewGetDatabaseExtensionsParams() - return nil - } - o.ExtensionType = &raw - - if err := o.validateExtensionType(formats); err != nil { - return err - } - - return nil -} - -// validateExtensionType carries on validations for parameter ExtensionType -func (o *GetDatabaseExtensionsParams) validateExtensionType(formats strfmt.Registry) error { - - if err := validate.EnumCase("extension_type", "query", *o.ExtensionType, []interface{}{"all", "contrib", "third_party"}, true); err != nil { - return err - } - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetDatabaseExtensionsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetDatabaseExtensionsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindPostgresVersion binds and validates parameter PostgresVersion from query. -func (o *GetDatabaseExtensionsParams) bindPostgresVersion(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.PostgresVersion = &raw - - return nil -} diff --git a/console/service/restapi/operations/dictionary/get_database_extensions_responses.go b/console/service/restapi/operations/dictionary/get_database_extensions_responses.go deleted file mode 100644 index c4f3d8c3b..000000000 --- a/console/service/restapi/operations/dictionary/get_database_extensions_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetDatabaseExtensionsOKCode is the HTTP code returned for type GetDatabaseExtensionsOK -const GetDatabaseExtensionsOKCode int = 200 - -/* -GetDatabaseExtensionsOK OK - -swagger:response getDatabaseExtensionsOK -*/ -type GetDatabaseExtensionsOK struct { - - /* - In: Body - */ - Payload *models.ResponseDatabaseExtensions `json:"body,omitempty"` -} - -// NewGetDatabaseExtensionsOK creates GetDatabaseExtensionsOK with default headers values -func NewGetDatabaseExtensionsOK() *GetDatabaseExtensionsOK { - - return &GetDatabaseExtensionsOK{} -} - -// WithPayload adds the payload to the get database extensions o k response -func (o *GetDatabaseExtensionsOK) WithPayload(payload *models.ResponseDatabaseExtensions) *GetDatabaseExtensionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get database extensions o k response -func (o *GetDatabaseExtensionsOK) SetPayload(payload *models.ResponseDatabaseExtensions) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDatabaseExtensionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDatabaseExtensionsBadRequestCode is the HTTP code returned for type GetDatabaseExtensionsBadRequest -const GetDatabaseExtensionsBadRequestCode int = 400 - -/* -GetDatabaseExtensionsBadRequest Error - -swagger:response getDatabaseExtensionsBadRequest -*/ -type GetDatabaseExtensionsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetDatabaseExtensionsBadRequest creates GetDatabaseExtensionsBadRequest with default headers values -func NewGetDatabaseExtensionsBadRequest() *GetDatabaseExtensionsBadRequest { - - return &GetDatabaseExtensionsBadRequest{} -} - -// WithPayload adds the payload to the get database extensions bad request response -func (o *GetDatabaseExtensionsBadRequest) WithPayload(payload *models.ResponseError) *GetDatabaseExtensionsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get database extensions bad request response -func (o *GetDatabaseExtensionsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDatabaseExtensionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/dictionary/get_database_extensions_urlbuilder.go b/console/service/restapi/operations/dictionary/get_database_extensions_urlbuilder.go deleted file mode 100644 index be2df9480..000000000 --- a/console/service/restapi/operations/dictionary/get_database_extensions_urlbuilder.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetDatabaseExtensionsURL generates an URL for the get database extensions operation -type GetDatabaseExtensionsURL struct { - ExtensionType *string - Limit *int64 - Offset *int64 - PostgresVersion *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetDatabaseExtensionsURL) WithBasePath(bp string) *GetDatabaseExtensionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetDatabaseExtensionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetDatabaseExtensionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/database/extensions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var extensionTypeQ string - if o.ExtensionType != nil { - extensionTypeQ = *o.ExtensionType - } - if extensionTypeQ != "" { - qs.Set("extension_type", extensionTypeQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var postgresVersionQ string - if o.PostgresVersion != nil { - postgresVersionQ = *o.PostgresVersion - } - if postgresVersionQ != "" { - qs.Set("postgres_version", postgresVersionQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetDatabaseExtensionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetDatabaseExtensionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetDatabaseExtensionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetDatabaseExtensionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetDatabaseExtensionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetDatabaseExtensionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/dictionary/get_external_deployments.go b/console/service/restapi/operations/dictionary/get_external_deployments.go deleted file mode 100644 index 34a4652a7..000000000 --- a/console/service/restapi/operations/dictionary/get_external_deployments.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetExternalDeploymentsHandlerFunc turns a function with the right signature into a get external deployments handler -type GetExternalDeploymentsHandlerFunc func(GetExternalDeploymentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetExternalDeploymentsHandlerFunc) Handle(params GetExternalDeploymentsParams) middleware.Responder { - return fn(params) -} - -// GetExternalDeploymentsHandler interface for that can handle valid get external deployments params -type GetExternalDeploymentsHandler interface { - Handle(GetExternalDeploymentsParams) middleware.Responder -} - -// NewGetExternalDeployments creates a new http.Handler for the get external deployments operation -func NewGetExternalDeployments(ctx *middleware.Context, handler GetExternalDeploymentsHandler) *GetExternalDeployments { - return &GetExternalDeployments{Context: ctx, Handler: handler} -} - -/* - GetExternalDeployments swagger:route GET /external/deployments dictionary getExternalDeployments - -Get full info about available external deployments -*/ -type GetExternalDeployments struct { - Context *middleware.Context - Handler GetExternalDeploymentsHandler -} - -func (o *GetExternalDeployments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetExternalDeploymentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/dictionary/get_external_deployments_parameters.go b/console/service/restapi/operations/dictionary/get_external_deployments_parameters.go deleted file mode 100644 index f4ab09453..000000000 --- a/console/service/restapi/operations/dictionary/get_external_deployments_parameters.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetExternalDeploymentsParams creates a new GetExternalDeploymentsParams object -// -// There are no default values defined in the spec. -func NewGetExternalDeploymentsParams() GetExternalDeploymentsParams { - - return GetExternalDeploymentsParams{} -} - -// GetExternalDeploymentsParams contains all the bound params for the get external deployments operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetExternalDeployments -type GetExternalDeploymentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetExternalDeploymentsParams() beforehand. -func (o *GetExternalDeploymentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetExternalDeploymentsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetExternalDeploymentsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/console/service/restapi/operations/dictionary/get_external_deployments_responses.go b/console/service/restapi/operations/dictionary/get_external_deployments_responses.go deleted file mode 100644 index 8e9a5d7c7..000000000 --- a/console/service/restapi/operations/dictionary/get_external_deployments_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetExternalDeploymentsOKCode is the HTTP code returned for type GetExternalDeploymentsOK -const GetExternalDeploymentsOKCode int = 200 - -/* -GetExternalDeploymentsOK OK - -swagger:response getExternalDeploymentsOK -*/ -type GetExternalDeploymentsOK struct { - - /* - In: Body - */ - Payload *models.ResponseDeploymentsInfo `json:"body,omitempty"` -} - -// NewGetExternalDeploymentsOK creates GetExternalDeploymentsOK with default headers values -func NewGetExternalDeploymentsOK() *GetExternalDeploymentsOK { - - return &GetExternalDeploymentsOK{} -} - -// WithPayload adds the payload to the get external deployments o k response -func (o *GetExternalDeploymentsOK) WithPayload(payload *models.ResponseDeploymentsInfo) *GetExternalDeploymentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get external deployments o k response -func (o *GetExternalDeploymentsOK) SetPayload(payload *models.ResponseDeploymentsInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetExternalDeploymentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetExternalDeploymentsBadRequestCode is the HTTP code returned for type GetExternalDeploymentsBadRequest -const GetExternalDeploymentsBadRequestCode int = 400 - -/* -GetExternalDeploymentsBadRequest Error - -swagger:response getExternalDeploymentsBadRequest -*/ -type GetExternalDeploymentsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetExternalDeploymentsBadRequest creates GetExternalDeploymentsBadRequest with default headers values -func NewGetExternalDeploymentsBadRequest() *GetExternalDeploymentsBadRequest { - - return &GetExternalDeploymentsBadRequest{} -} - -// WithPayload adds the payload to the get external deployments bad request response -func (o *GetExternalDeploymentsBadRequest) WithPayload(payload *models.ResponseError) *GetExternalDeploymentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get external deployments bad request response -func (o *GetExternalDeploymentsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetExternalDeploymentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/dictionary/get_external_deployments_urlbuilder.go b/console/service/restapi/operations/dictionary/get_external_deployments_urlbuilder.go deleted file mode 100644 index 73847e2a6..000000000 --- a/console/service/restapi/operations/dictionary/get_external_deployments_urlbuilder.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetExternalDeploymentsURL generates an URL for the get external deployments operation -type GetExternalDeploymentsURL struct { - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetExternalDeploymentsURL) WithBasePath(bp string) *GetExternalDeploymentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetExternalDeploymentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetExternalDeploymentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external/deployments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetExternalDeploymentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetExternalDeploymentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetExternalDeploymentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetExternalDeploymentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetExternalDeploymentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetExternalDeploymentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/dictionary/get_postgres_versions.go b/console/service/restapi/operations/dictionary/get_postgres_versions.go deleted file mode 100644 index e6ac32966..000000000 --- a/console/service/restapi/operations/dictionary/get_postgres_versions.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPostgresVersionsHandlerFunc turns a function with the right signature into a get postgres versions handler -type GetPostgresVersionsHandlerFunc func(GetPostgresVersionsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPostgresVersionsHandlerFunc) Handle(params GetPostgresVersionsParams) middleware.Responder { - return fn(params) -} - -// GetPostgresVersionsHandler interface for that can handle valid get postgres versions params -type GetPostgresVersionsHandler interface { - Handle(GetPostgresVersionsParams) middleware.Responder -} - -// NewGetPostgresVersions creates a new http.Handler for the get postgres versions operation -func NewGetPostgresVersions(ctx *middleware.Context, handler GetPostgresVersionsHandler) *GetPostgresVersions { - return &GetPostgresVersions{Context: ctx, Handler: handler} -} - -/* - GetPostgresVersions swagger:route GET /postgres_versions dictionary getPostgresVersions - -Get supported postgres versions -*/ -type GetPostgresVersions struct { - Context *middleware.Context - Handler GetPostgresVersionsHandler -} - -func (o *GetPostgresVersions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPostgresVersionsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/dictionary/get_postgres_versions_parameters.go b/console/service/restapi/operations/dictionary/get_postgres_versions_parameters.go deleted file mode 100644 index 8d4670728..000000000 --- a/console/service/restapi/operations/dictionary/get_postgres_versions_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetPostgresVersionsParams creates a new GetPostgresVersionsParams object -// -// There are no default values defined in the spec. -func NewGetPostgresVersionsParams() GetPostgresVersionsParams { - - return GetPostgresVersionsParams{} -} - -// GetPostgresVersionsParams contains all the bound params for the get postgres versions operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetPostgresVersions -type GetPostgresVersionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPostgresVersionsParams() beforehand. -func (o *GetPostgresVersionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/dictionary/get_postgres_versions_responses.go b/console/service/restapi/operations/dictionary/get_postgres_versions_responses.go deleted file mode 100644 index b6643e1a1..000000000 --- a/console/service/restapi/operations/dictionary/get_postgres_versions_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetPostgresVersionsOKCode is the HTTP code returned for type GetPostgresVersionsOK -const GetPostgresVersionsOKCode int = 200 - -/* -GetPostgresVersionsOK OK - -swagger:response getPostgresVersionsOK -*/ -type GetPostgresVersionsOK struct { - - /* - In: Body - */ - Payload *models.ResponsePostgresVersions `json:"body,omitempty"` -} - -// NewGetPostgresVersionsOK creates GetPostgresVersionsOK with default headers values -func NewGetPostgresVersionsOK() *GetPostgresVersionsOK { - - return &GetPostgresVersionsOK{} -} - -// WithPayload adds the payload to the get postgres versions o k response -func (o *GetPostgresVersionsOK) WithPayload(payload *models.ResponsePostgresVersions) *GetPostgresVersionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get postgres versions o k response -func (o *GetPostgresVersionsOK) SetPayload(payload *models.ResponsePostgresVersions) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPostgresVersionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPostgresVersionsBadRequestCode is the HTTP code returned for type GetPostgresVersionsBadRequest -const GetPostgresVersionsBadRequestCode int = 400 - -/* -GetPostgresVersionsBadRequest Error - -swagger:response getPostgresVersionsBadRequest -*/ -type GetPostgresVersionsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetPostgresVersionsBadRequest creates GetPostgresVersionsBadRequest with default headers values -func NewGetPostgresVersionsBadRequest() *GetPostgresVersionsBadRequest { - - return &GetPostgresVersionsBadRequest{} -} - -// WithPayload adds the payload to the get postgres versions bad request response -func (o *GetPostgresVersionsBadRequest) WithPayload(payload *models.ResponseError) *GetPostgresVersionsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get postgres versions bad request response -func (o *GetPostgresVersionsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPostgresVersionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/dictionary/get_postgres_versions_urlbuilder.go b/console/service/restapi/operations/dictionary/get_postgres_versions_urlbuilder.go deleted file mode 100644 index c54b42d6d..000000000 --- a/console/service/restapi/operations/dictionary/get_postgres_versions_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package dictionary - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetPostgresVersionsURL generates an URL for the get postgres versions operation -type GetPostgresVersionsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPostgresVersionsURL) WithBasePath(bp string) *GetPostgresVersionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPostgresVersionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPostgresVersionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/postgres_versions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPostgresVersionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPostgresVersionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPostgresVersionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPostgresVersionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPostgresVersionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPostgresVersionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/environment/delete_environments_id.go b/console/service/restapi/operations/environment/delete_environments_id.go deleted file mode 100644 index 3b9b72db3..000000000 --- a/console/service/restapi/operations/environment/delete_environments_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteEnvironmentsIDHandlerFunc turns a function with the right signature into a delete environments ID handler -type DeleteEnvironmentsIDHandlerFunc func(DeleteEnvironmentsIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteEnvironmentsIDHandlerFunc) Handle(params DeleteEnvironmentsIDParams) middleware.Responder { - return fn(params) -} - -// DeleteEnvironmentsIDHandler interface for that can handle valid delete environments ID params -type DeleteEnvironmentsIDHandler interface { - Handle(DeleteEnvironmentsIDParams) middleware.Responder -} - -// NewDeleteEnvironmentsID creates a new http.Handler for the delete environments ID operation -func NewDeleteEnvironmentsID(ctx *middleware.Context, handler DeleteEnvironmentsIDHandler) *DeleteEnvironmentsID { - return &DeleteEnvironmentsID{Context: ctx, Handler: handler} -} - -/* - DeleteEnvironmentsID swagger:route DELETE /environments/{id} environment deleteEnvironmentsId - -Delete environment -*/ -type DeleteEnvironmentsID struct { - Context *middleware.Context - Handler DeleteEnvironmentsIDHandler -} - -func (o *DeleteEnvironmentsID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteEnvironmentsIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/environment/delete_environments_id_parameters.go b/console/service/restapi/operations/environment/delete_environments_id_parameters.go deleted file mode 100644 index 24c502419..000000000 --- a/console/service/restapi/operations/environment/delete_environments_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewDeleteEnvironmentsIDParams creates a new DeleteEnvironmentsIDParams object -// -// There are no default values defined in the spec. -func NewDeleteEnvironmentsIDParams() DeleteEnvironmentsIDParams { - - return DeleteEnvironmentsIDParams{} -} - -// DeleteEnvironmentsIDParams contains all the bound params for the delete environments ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteEnvironmentsID -type DeleteEnvironmentsIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteEnvironmentsIDParams() beforehand. -func (o *DeleteEnvironmentsIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteEnvironmentsIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/environment/delete_environments_id_responses.go b/console/service/restapi/operations/environment/delete_environments_id_responses.go deleted file mode 100644 index 85f33ffa8..000000000 --- a/console/service/restapi/operations/environment/delete_environments_id_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// DeleteEnvironmentsIDNoContentCode is the HTTP code returned for type DeleteEnvironmentsIDNoContent -const DeleteEnvironmentsIDNoContentCode int = 204 - -/* -DeleteEnvironmentsIDNoContent OK - -swagger:response deleteEnvironmentsIdNoContent -*/ -type DeleteEnvironmentsIDNoContent struct { -} - -// NewDeleteEnvironmentsIDNoContent creates DeleteEnvironmentsIDNoContent with default headers values -func NewDeleteEnvironmentsIDNoContent() *DeleteEnvironmentsIDNoContent { - - return &DeleteEnvironmentsIDNoContent{} -} - -// WriteResponse to the client -func (o *DeleteEnvironmentsIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteEnvironmentsIDBadRequestCode is the HTTP code returned for type DeleteEnvironmentsIDBadRequest -const DeleteEnvironmentsIDBadRequestCode int = 400 - -/* -DeleteEnvironmentsIDBadRequest Error - -swagger:response deleteEnvironmentsIdBadRequest -*/ -type DeleteEnvironmentsIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewDeleteEnvironmentsIDBadRequest creates DeleteEnvironmentsIDBadRequest with default headers values -func NewDeleteEnvironmentsIDBadRequest() *DeleteEnvironmentsIDBadRequest { - - return &DeleteEnvironmentsIDBadRequest{} -} - -// WithPayload adds the payload to the delete environments Id bad request response -func (o *DeleteEnvironmentsIDBadRequest) WithPayload(payload *models.ResponseError) *DeleteEnvironmentsIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete environments Id bad request response -func (o *DeleteEnvironmentsIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEnvironmentsIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/environment/delete_environments_id_urlbuilder.go b/console/service/restapi/operations/environment/delete_environments_id_urlbuilder.go deleted file mode 100644 index 1c70b9ee1..000000000 --- a/console/service/restapi/operations/environment/delete_environments_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// DeleteEnvironmentsIDURL generates an URL for the delete environments ID operation -type DeleteEnvironmentsIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEnvironmentsIDURL) WithBasePath(bp string) *DeleteEnvironmentsIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEnvironmentsIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteEnvironmentsIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/environments/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteEnvironmentsIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteEnvironmentsIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteEnvironmentsIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteEnvironmentsIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteEnvironmentsIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteEnvironmentsIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteEnvironmentsIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/environment/get_environments.go b/console/service/restapi/operations/environment/get_environments.go deleted file mode 100644 index 88d1e8c10..000000000 --- a/console/service/restapi/operations/environment/get_environments.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetEnvironmentsHandlerFunc turns a function with the right signature into a get environments handler -type GetEnvironmentsHandlerFunc func(GetEnvironmentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetEnvironmentsHandlerFunc) Handle(params GetEnvironmentsParams) middleware.Responder { - return fn(params) -} - -// GetEnvironmentsHandler interface for that can handle valid get environments params -type GetEnvironmentsHandler interface { - Handle(GetEnvironmentsParams) middleware.Responder -} - -// NewGetEnvironments creates a new http.Handler for the get environments operation -func NewGetEnvironments(ctx *middleware.Context, handler GetEnvironmentsHandler) *GetEnvironments { - return &GetEnvironments{Context: ctx, Handler: handler} -} - -/* - GetEnvironments swagger:route GET /environments environment getEnvironments - -Get environemtns list -*/ -type GetEnvironments struct { - Context *middleware.Context - Handler GetEnvironmentsHandler -} - -func (o *GetEnvironments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetEnvironmentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/environment/get_environments_parameters.go b/console/service/restapi/operations/environment/get_environments_parameters.go deleted file mode 100644 index 90c25aae9..000000000 --- a/console/service/restapi/operations/environment/get_environments_parameters.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetEnvironmentsParams creates a new GetEnvironmentsParams object -// -// There are no default values defined in the spec. -func NewGetEnvironmentsParams() GetEnvironmentsParams { - - return GetEnvironmentsParams{} -} - -// GetEnvironmentsParams contains all the bound params for the get environments operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetEnvironments -type GetEnvironmentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetEnvironmentsParams() beforehand. -func (o *GetEnvironmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetEnvironmentsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetEnvironmentsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/console/service/restapi/operations/environment/get_environments_responses.go b/console/service/restapi/operations/environment/get_environments_responses.go deleted file mode 100644 index 10eeb4aef..000000000 --- a/console/service/restapi/operations/environment/get_environments_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetEnvironmentsOKCode is the HTTP code returned for type GetEnvironmentsOK -const GetEnvironmentsOKCode int = 200 - -/* -GetEnvironmentsOK OK - -swagger:response getEnvironmentsOK -*/ -type GetEnvironmentsOK struct { - - /* - In: Body - */ - Payload *models.ResponseEnvironmentsList `json:"body,omitempty"` -} - -// NewGetEnvironmentsOK creates GetEnvironmentsOK with default headers values -func NewGetEnvironmentsOK() *GetEnvironmentsOK { - - return &GetEnvironmentsOK{} -} - -// WithPayload adds the payload to the get environments o k response -func (o *GetEnvironmentsOK) WithPayload(payload *models.ResponseEnvironmentsList) *GetEnvironmentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get environments o k response -func (o *GetEnvironmentsOK) SetPayload(payload *models.ResponseEnvironmentsList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEnvironmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEnvironmentsBadRequestCode is the HTTP code returned for type GetEnvironmentsBadRequest -const GetEnvironmentsBadRequestCode int = 400 - -/* -GetEnvironmentsBadRequest Error - -swagger:response getEnvironmentsBadRequest -*/ -type GetEnvironmentsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetEnvironmentsBadRequest creates GetEnvironmentsBadRequest with default headers values -func NewGetEnvironmentsBadRequest() *GetEnvironmentsBadRequest { - - return &GetEnvironmentsBadRequest{} -} - -// WithPayload adds the payload to the get environments bad request response -func (o *GetEnvironmentsBadRequest) WithPayload(payload *models.ResponseError) *GetEnvironmentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get environments bad request response -func (o *GetEnvironmentsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEnvironmentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/environment/get_environments_urlbuilder.go b/console/service/restapi/operations/environment/get_environments_urlbuilder.go deleted file mode 100644 index 91cd1362b..000000000 --- a/console/service/restapi/operations/environment/get_environments_urlbuilder.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetEnvironmentsURL generates an URL for the get environments operation -type GetEnvironmentsURL struct { - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEnvironmentsURL) WithBasePath(bp string) *GetEnvironmentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEnvironmentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetEnvironmentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/environments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetEnvironmentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetEnvironmentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetEnvironmentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetEnvironmentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetEnvironmentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetEnvironmentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/environment/post_environments.go b/console/service/restapi/operations/environment/post_environments.go deleted file mode 100644 index 6b17684a4..000000000 --- a/console/service/restapi/operations/environment/post_environments.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostEnvironmentsHandlerFunc turns a function with the right signature into a post environments handler -type PostEnvironmentsHandlerFunc func(PostEnvironmentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostEnvironmentsHandlerFunc) Handle(params PostEnvironmentsParams) middleware.Responder { - return fn(params) -} - -// PostEnvironmentsHandler interface for that can handle valid post environments params -type PostEnvironmentsHandler interface { - Handle(PostEnvironmentsParams) middleware.Responder -} - -// NewPostEnvironments creates a new http.Handler for the post environments operation -func NewPostEnvironments(ctx *middleware.Context, handler PostEnvironmentsHandler) *PostEnvironments { - return &PostEnvironments{Context: ctx, Handler: handler} -} - -/* - PostEnvironments swagger:route POST /environments environment postEnvironments - -Create environemtn -*/ -type PostEnvironments struct { - Context *middleware.Context - Handler PostEnvironmentsHandler -} - -func (o *PostEnvironments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostEnvironmentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/environment/post_environments_parameters.go b/console/service/restapi/operations/environment/post_environments_parameters.go deleted file mode 100644 index e3336fa01..000000000 --- a/console/service/restapi/operations/environment/post_environments_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPostEnvironmentsParams creates a new PostEnvironmentsParams object -// -// There are no default values defined in the spec. -func NewPostEnvironmentsParams() PostEnvironmentsParams { - - return PostEnvironmentsParams{} -} - -// PostEnvironmentsParams contains all the bound params for the post environments operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostEnvironments -type PostEnvironmentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestEnvironment -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostEnvironmentsParams() beforehand. -func (o *PostEnvironmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestEnvironment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/environment/post_environments_responses.go b/console/service/restapi/operations/environment/post_environments_responses.go deleted file mode 100644 index 87f7e0779..000000000 --- a/console/service/restapi/operations/environment/post_environments_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostEnvironmentsOKCode is the HTTP code returned for type PostEnvironmentsOK -const PostEnvironmentsOKCode int = 200 - -/* -PostEnvironmentsOK OK - -swagger:response postEnvironmentsOK -*/ -type PostEnvironmentsOK struct { - - /* - In: Body - */ - Payload *models.ResponseEnvironment `json:"body,omitempty"` -} - -// NewPostEnvironmentsOK creates PostEnvironmentsOK with default headers values -func NewPostEnvironmentsOK() *PostEnvironmentsOK { - - return &PostEnvironmentsOK{} -} - -// WithPayload adds the payload to the post environments o k response -func (o *PostEnvironmentsOK) WithPayload(payload *models.ResponseEnvironment) *PostEnvironmentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post environments o k response -func (o *PostEnvironmentsOK) SetPayload(payload *models.ResponseEnvironment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEnvironmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostEnvironmentsBadRequestCode is the HTTP code returned for type PostEnvironmentsBadRequest -const PostEnvironmentsBadRequestCode int = 400 - -/* -PostEnvironmentsBadRequest Error - -swagger:response postEnvironmentsBadRequest -*/ -type PostEnvironmentsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostEnvironmentsBadRequest creates PostEnvironmentsBadRequest with default headers values -func NewPostEnvironmentsBadRequest() *PostEnvironmentsBadRequest { - - return &PostEnvironmentsBadRequest{} -} - -// WithPayload adds the payload to the post environments bad request response -func (o *PostEnvironmentsBadRequest) WithPayload(payload *models.ResponseError) *PostEnvironmentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post environments bad request response -func (o *PostEnvironmentsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEnvironmentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/environment/post_environments_urlbuilder.go b/console/service/restapi/operations/environment/post_environments_urlbuilder.go deleted file mode 100644 index 879977065..000000000 --- a/console/service/restapi/operations/environment/post_environments_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package environment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostEnvironmentsURL generates an URL for the post environments operation -type PostEnvironmentsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostEnvironmentsURL) WithBasePath(bp string) *PostEnvironmentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostEnvironmentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostEnvironmentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/environments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostEnvironmentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostEnvironmentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostEnvironmentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostEnvironmentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostEnvironmentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostEnvironmentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/operation/get_operations.go b/console/service/restapi/operations/operation/get_operations.go deleted file mode 100644 index 0e61544c1..000000000 --- a/console/service/restapi/operations/operation/get_operations.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetOperationsHandlerFunc turns a function with the right signature into a get operations handler -type GetOperationsHandlerFunc func(GetOperationsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetOperationsHandlerFunc) Handle(params GetOperationsParams) middleware.Responder { - return fn(params) -} - -// GetOperationsHandler interface for that can handle valid get operations params -type GetOperationsHandler interface { - Handle(GetOperationsParams) middleware.Responder -} - -// NewGetOperations creates a new http.Handler for the get operations operation -func NewGetOperations(ctx *middleware.Context, handler GetOperationsHandler) *GetOperations { - return &GetOperations{Context: ctx, Handler: handler} -} - -/* - GetOperations swagger:route GET /operations operation getOperations - -Get operations list for current project -*/ -type GetOperations struct { - Context *middleware.Context - Handler GetOperationsHandler -} - -func (o *GetOperations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetOperationsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/operation/get_operations_id_log.go b/console/service/restapi/operations/operation/get_operations_id_log.go deleted file mode 100644 index 74e6007ef..000000000 --- a/console/service/restapi/operations/operation/get_operations_id_log.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetOperationsIDLogHandlerFunc turns a function with the right signature into a get operations ID log handler -type GetOperationsIDLogHandlerFunc func(GetOperationsIDLogParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetOperationsIDLogHandlerFunc) Handle(params GetOperationsIDLogParams) middleware.Responder { - return fn(params) -} - -// GetOperationsIDLogHandler interface for that can handle valid get operations ID log params -type GetOperationsIDLogHandler interface { - Handle(GetOperationsIDLogParams) middleware.Responder -} - -// NewGetOperationsIDLog creates a new http.Handler for the get operations ID log operation -func NewGetOperationsIDLog(ctx *middleware.Context, handler GetOperationsIDLogHandler) *GetOperationsIDLog { - return &GetOperationsIDLog{Context: ctx, Handler: handler} -} - -/* - GetOperationsIDLog swagger:route GET /operations/{id}/log operation getOperationsIdLog - -Get operation log by operation_id -*/ -type GetOperationsIDLog struct { - Context *middleware.Context - Handler GetOperationsIDLogHandler -} - -func (o *GetOperationsIDLog) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetOperationsIDLogParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/operation/get_operations_id_log_parameters.go b/console/service/restapi/operations/operation/get_operations_id_log_parameters.go deleted file mode 100644 index a7c718948..000000000 --- a/console/service/restapi/operations/operation/get_operations_id_log_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetOperationsIDLogParams creates a new GetOperationsIDLogParams object -// -// There are no default values defined in the spec. -func NewGetOperationsIDLogParams() GetOperationsIDLogParams { - - return GetOperationsIDLogParams{} -} - -// GetOperationsIDLogParams contains all the bound params for the get operations ID log operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetOperationsIDLog -type GetOperationsIDLogParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Operation id - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetOperationsIDLogParams() beforehand. -func (o *GetOperationsIDLogParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetOperationsIDLogParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/operation/get_operations_id_log_responses.go b/console/service/restapi/operations/operation/get_operations_id_log_responses.go deleted file mode 100644 index cdc816538..000000000 --- a/console/service/restapi/operations/operation/get_operations_id_log_responses.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/models" -) - -// GetOperationsIDLogOKCode is the HTTP code returned for type GetOperationsIDLogOK -const GetOperationsIDLogOKCode int = 200 - -/* -GetOperationsIDLogOK OK - -swagger:response getOperationsIdLogOK -*/ -type GetOperationsIDLogOK struct { - /* - - */ - ContentType string `json:"content-type"` - /* - - */ - XLogCompleted bool `json:"x-log-completed"` - - /* - In: Body - */ - Payload string `json:"body,omitempty"` -} - -// NewGetOperationsIDLogOK creates GetOperationsIDLogOK with default headers values -func NewGetOperationsIDLogOK() *GetOperationsIDLogOK { - - return &GetOperationsIDLogOK{} -} - -// WithContentType adds the contentType to the get operations Id log o k response -func (o *GetOperationsIDLogOK) WithContentType(contentType string) *GetOperationsIDLogOK { - o.ContentType = contentType - return o -} - -// SetContentType sets the contentType to the get operations Id log o k response -func (o *GetOperationsIDLogOK) SetContentType(contentType string) { - o.ContentType = contentType -} - -// WithXLogCompleted adds the xLogCompleted to the get operations Id log o k response -func (o *GetOperationsIDLogOK) WithXLogCompleted(xLogCompleted bool) *GetOperationsIDLogOK { - o.XLogCompleted = xLogCompleted - return o -} - -// SetXLogCompleted sets the xLogCompleted to the get operations Id log o k response -func (o *GetOperationsIDLogOK) SetXLogCompleted(xLogCompleted bool) { - o.XLogCompleted = xLogCompleted -} - -// WithPayload adds the payload to the get operations Id log o k response -func (o *GetOperationsIDLogOK) WithPayload(payload string) *GetOperationsIDLogOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get operations Id log o k response -func (o *GetOperationsIDLogOK) SetPayload(payload string) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOperationsIDLogOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header content-type - - contentType := o.ContentType - if contentType != "" { - rw.Header().Set("content-type", contentType) - } - - // response header x-log-completed - - xLogCompleted := swag.FormatBool(o.XLogCompleted) - if xLogCompleted != "" { - rw.Header().Set("x-log-completed", xLogCompleted) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetOperationsIDLogBadRequestCode is the HTTP code returned for type GetOperationsIDLogBadRequest -const GetOperationsIDLogBadRequestCode int = 400 - -/* -GetOperationsIDLogBadRequest Error - -swagger:response getOperationsIdLogBadRequest -*/ -type GetOperationsIDLogBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetOperationsIDLogBadRequest creates GetOperationsIDLogBadRequest with default headers values -func NewGetOperationsIDLogBadRequest() *GetOperationsIDLogBadRequest { - - return &GetOperationsIDLogBadRequest{} -} - -// WithPayload adds the payload to the get operations Id log bad request response -func (o *GetOperationsIDLogBadRequest) WithPayload(payload *models.ResponseError) *GetOperationsIDLogBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get operations Id log bad request response -func (o *GetOperationsIDLogBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOperationsIDLogBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/operation/get_operations_id_log_urlbuilder.go b/console/service/restapi/operations/operation/get_operations_id_log_urlbuilder.go deleted file mode 100644 index 308133be8..000000000 --- a/console/service/restapi/operations/operation/get_operations_id_log_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// GetOperationsIDLogURL generates an URL for the get operations ID log operation -type GetOperationsIDLogURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOperationsIDLogURL) WithBasePath(bp string) *GetOperationsIDLogURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOperationsIDLogURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetOperationsIDLogURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/operations/{id}/log" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetOperationsIDLogURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetOperationsIDLogURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetOperationsIDLogURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetOperationsIDLogURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetOperationsIDLogURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetOperationsIDLogURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetOperationsIDLogURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/operation/get_operations_parameters.go b/console/service/restapi/operations/operation/get_operations_parameters.go deleted file mode 100644 index 3aeccb99f..000000000 --- a/console/service/restapi/operations/operation/get_operations_parameters.go +++ /dev/null @@ -1,397 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetOperationsParams creates a new GetOperationsParams object -// -// There are no default values defined in the spec. -func NewGetOperationsParams() GetOperationsParams { - - return GetOperationsParams{} -} - -// GetOperationsParams contains all the bound params for the get operations operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetOperations -type GetOperationsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Filter by cluster_name - In: query - */ - ClusterName *string - /*Operations started till this date - Required: true - In: query - */ - EndDate strfmt.DateTime - /*Filter by environment - In: query - */ - Environment *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /*Required parameter for filter - Required: true - In: query - */ - ProjectID int64 - /*Sort by fields. Example: sort_by=cluster_name,-type,status,id,created_at,updated_at - Supported valuese: - - id - - cluster_name - - type - - status - - started_at - - updated_at - - cluster - - environment - - In: query - */ - SortBy *string - /*Operations started after this date - Required: true - In: query - */ - StartDate strfmt.DateTime - /*Filter by status - In: query - */ - Status *string - /*Filter by type - In: query - */ - Type *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetOperationsParams() beforehand. -func (o *GetOperationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qClusterName, qhkClusterName, _ := qs.GetOK("cluster_name") - if err := o.bindClusterName(qClusterName, qhkClusterName, route.Formats); err != nil { - res = append(res, err) - } - - qEndDate, qhkEndDate, _ := qs.GetOK("end_date") - if err := o.bindEndDate(qEndDate, qhkEndDate, route.Formats); err != nil { - res = append(res, err) - } - - qEnvironment, qhkEnvironment, _ := qs.GetOK("environment") - if err := o.bindEnvironment(qEnvironment, qhkEnvironment, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qProjectID, qhkProjectID, _ := qs.GetOK("project_id") - if err := o.bindProjectID(qProjectID, qhkProjectID, route.Formats); err != nil { - res = append(res, err) - } - - qSortBy, qhkSortBy, _ := qs.GetOK("sort_by") - if err := o.bindSortBy(qSortBy, qhkSortBy, route.Formats); err != nil { - res = append(res, err) - } - - qStartDate, qhkStartDate, _ := qs.GetOK("start_date") - if err := o.bindStartDate(qStartDate, qhkStartDate, route.Formats); err != nil { - res = append(res, err) - } - - qStatus, qhkStatus, _ := qs.GetOK("status") - if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { - res = append(res, err) - } - - qType, qhkType, _ := qs.GetOK("type") - if err := o.bindType(qType, qhkType, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindClusterName binds and validates parameter ClusterName from query. -func (o *GetOperationsParams) bindClusterName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.ClusterName = &raw - - return nil -} - -// bindEndDate binds and validates parameter EndDate from query. -func (o *GetOperationsParams) bindEndDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("end_date", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("end_date", "query", raw); err != nil { - return err - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("end_date", "query", "strfmt.DateTime", raw) - } - o.EndDate = *(value.(*strfmt.DateTime)) - - if err := o.validateEndDate(formats); err != nil { - return err - } - - return nil -} - -// validateEndDate carries on validations for parameter EndDate -func (o *GetOperationsParams) validateEndDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("end_date", "query", "date-time", o.EndDate.String(), formats); err != nil { - return err - } - return nil -} - -// bindEnvironment binds and validates parameter Environment from query. -func (o *GetOperationsParams) bindEnvironment(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Environment = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetOperationsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetOperationsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindProjectID binds and validates parameter ProjectID from query. -func (o *GetOperationsParams) bindProjectID(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("project_id", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("project_id", "query", raw); err != nil { - return err - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("project_id", "query", "int64", raw) - } - o.ProjectID = value - - return nil -} - -// bindSortBy binds and validates parameter SortBy from query. -func (o *GetOperationsParams) bindSortBy(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.SortBy = &raw - - return nil -} - -// bindStartDate binds and validates parameter StartDate from query. -func (o *GetOperationsParams) bindStartDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("start_date", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("start_date", "query", raw); err != nil { - return err - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("start_date", "query", "strfmt.DateTime", raw) - } - o.StartDate = *(value.(*strfmt.DateTime)) - - if err := o.validateStartDate(formats); err != nil { - return err - } - - return nil -} - -// validateStartDate carries on validations for parameter StartDate -func (o *GetOperationsParams) validateStartDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("start_date", "query", "date-time", o.StartDate.String(), formats); err != nil { - return err - } - return nil -} - -// bindStatus binds and validates parameter Status from query. -func (o *GetOperationsParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Status = &raw - - return nil -} - -// bindType binds and validates parameter Type from query. -func (o *GetOperationsParams) bindType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Type = &raw - - return nil -} diff --git a/console/service/restapi/operations/operation/get_operations_responses.go b/console/service/restapi/operations/operation/get_operations_responses.go deleted file mode 100644 index 40f8148a6..000000000 --- a/console/service/restapi/operations/operation/get_operations_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetOperationsOKCode is the HTTP code returned for type GetOperationsOK -const GetOperationsOKCode int = 200 - -/* -GetOperationsOK OK - -swagger:response getOperationsOK -*/ -type GetOperationsOK struct { - - /* - In: Body - */ - Payload *models.ResponseOperationsList `json:"body,omitempty"` -} - -// NewGetOperationsOK creates GetOperationsOK with default headers values -func NewGetOperationsOK() *GetOperationsOK { - - return &GetOperationsOK{} -} - -// WithPayload adds the payload to the get operations o k response -func (o *GetOperationsOK) WithPayload(payload *models.ResponseOperationsList) *GetOperationsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get operations o k response -func (o *GetOperationsOK) SetPayload(payload *models.ResponseOperationsList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOperationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOperationsBadRequestCode is the HTTP code returned for type GetOperationsBadRequest -const GetOperationsBadRequestCode int = 400 - -/* -GetOperationsBadRequest Error - -swagger:response getOperationsBadRequest -*/ -type GetOperationsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetOperationsBadRequest creates GetOperationsBadRequest with default headers values -func NewGetOperationsBadRequest() *GetOperationsBadRequest { - - return &GetOperationsBadRequest{} -} - -// WithPayload adds the payload to the get operations bad request response -func (o *GetOperationsBadRequest) WithPayload(payload *models.ResponseError) *GetOperationsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get operations bad request response -func (o *GetOperationsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOperationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/operation/get_operations_urlbuilder.go b/console/service/restapi/operations/operation/get_operations_urlbuilder.go deleted file mode 100644 index 354593fdc..000000000 --- a/console/service/restapi/operations/operation/get_operations_urlbuilder.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operation - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetOperationsURL generates an URL for the get operations operation -type GetOperationsURL struct { - ClusterName *string - EndDate strfmt.DateTime - Environment *string - Limit *int64 - Offset *int64 - ProjectID int64 - SortBy *string - StartDate strfmt.DateTime - Status *string - Type *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOperationsURL) WithBasePath(bp string) *GetOperationsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOperationsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetOperationsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/operations" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var clusterNameQ string - if o.ClusterName != nil { - clusterNameQ = *o.ClusterName - } - if clusterNameQ != "" { - qs.Set("cluster_name", clusterNameQ) - } - - endDateQ := o.EndDate.String() - if endDateQ != "" { - qs.Set("end_date", endDateQ) - } - - var environmentQ string - if o.Environment != nil { - environmentQ = *o.Environment - } - if environmentQ != "" { - qs.Set("environment", environmentQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - projectIDQ := swag.FormatInt64(o.ProjectID) - if projectIDQ != "" { - qs.Set("project_id", projectIDQ) - } - - var sortByQ string - if o.SortBy != nil { - sortByQ = *o.SortBy - } - if sortByQ != "" { - qs.Set("sort_by", sortByQ) - } - - startDateQ := o.StartDate.String() - if startDateQ != "" { - qs.Set("start_date", startDateQ) - } - - var statusQ string - if o.Status != nil { - statusQ = *o.Status - } - if statusQ != "" { - qs.Set("status", statusQ) - } - - var typeVarQ string - if o.Type != nil { - typeVarQ = *o.Type - } - if typeVarQ != "" { - qs.Set("type", typeVarQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetOperationsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetOperationsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetOperationsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetOperationsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetOperationsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetOperationsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/pg_console_api.go b/console/service/restapi/operations/pg_console_api.go deleted file mode 100644 index 23cdcb086..000000000 --- a/console/service/restapi/operations/pg_console_api.go +++ /dev/null @@ -1,706 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "postgesql-cluster-console/restapi/operations/cluster" - "postgesql-cluster-console/restapi/operations/dictionary" - "postgesql-cluster-console/restapi/operations/environment" - "postgesql-cluster-console/restapi/operations/operation" - "postgesql-cluster-console/restapi/operations/project" - "postgesql-cluster-console/restapi/operations/secret" - "postgesql-cluster-console/restapi/operations/setting" - "postgesql-cluster-console/restapi/operations/system" -) - -// NewPgConsoleAPI creates a new PgConsole instance -func NewPgConsoleAPI(spec *loads.Document) *PgConsoleAPI { - return &PgConsoleAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - PlainTextConsumer: runtime.ConsumerFunc(func(r io.Reader, target interface{}) error { - return errors.NotImplemented("plainText consumer has not yet been implemented") - }), - - JSONProducer: runtime.JSONProducer(), - - ClusterDeleteClustersIDHandler: cluster.DeleteClustersIDHandlerFunc(func(params cluster.DeleteClustersIDParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.DeleteClustersID has not yet been implemented") - }), - EnvironmentDeleteEnvironmentsIDHandler: environment.DeleteEnvironmentsIDHandlerFunc(func(params environment.DeleteEnvironmentsIDParams) middleware.Responder { - return middleware.NotImplemented("operation environment.DeleteEnvironmentsID has not yet been implemented") - }), - ProjectDeleteProjectsIDHandler: project.DeleteProjectsIDHandlerFunc(func(params project.DeleteProjectsIDParams) middleware.Responder { - return middleware.NotImplemented("operation project.DeleteProjectsID has not yet been implemented") - }), - SecretDeleteSecretsIDHandler: secret.DeleteSecretsIDHandlerFunc(func(params secret.DeleteSecretsIDParams) middleware.Responder { - return middleware.NotImplemented("operation secret.DeleteSecretsID has not yet been implemented") - }), - ClusterDeleteServersIDHandler: cluster.DeleteServersIDHandlerFunc(func(params cluster.DeleteServersIDParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.DeleteServersID has not yet been implemented") - }), - ClusterGetClustersHandler: cluster.GetClustersHandlerFunc(func(params cluster.GetClustersParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.GetClusters has not yet been implemented") - }), - ClusterGetClustersDefaultNameHandler: cluster.GetClustersDefaultNameHandlerFunc(func(params cluster.GetClustersDefaultNameParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.GetClustersDefaultName has not yet been implemented") - }), - ClusterGetClustersIDHandler: cluster.GetClustersIDHandlerFunc(func(params cluster.GetClustersIDParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.GetClustersID has not yet been implemented") - }), - DictionaryGetDatabaseExtensionsHandler: dictionary.GetDatabaseExtensionsHandlerFunc(func(params dictionary.GetDatabaseExtensionsParams) middleware.Responder { - return middleware.NotImplemented("operation dictionary.GetDatabaseExtensions has not yet been implemented") - }), - EnvironmentGetEnvironmentsHandler: environment.GetEnvironmentsHandlerFunc(func(params environment.GetEnvironmentsParams) middleware.Responder { - return middleware.NotImplemented("operation environment.GetEnvironments has not yet been implemented") - }), - DictionaryGetExternalDeploymentsHandler: dictionary.GetExternalDeploymentsHandlerFunc(func(params dictionary.GetExternalDeploymentsParams) middleware.Responder { - return middleware.NotImplemented("operation dictionary.GetExternalDeployments has not yet been implemented") - }), - OperationGetOperationsHandler: operation.GetOperationsHandlerFunc(func(params operation.GetOperationsParams) middleware.Responder { - return middleware.NotImplemented("operation operation.GetOperations has not yet been implemented") - }), - OperationGetOperationsIDLogHandler: operation.GetOperationsIDLogHandlerFunc(func(params operation.GetOperationsIDLogParams) middleware.Responder { - return middleware.NotImplemented("operation operation.GetOperationsIDLog has not yet been implemented") - }), - DictionaryGetPostgresVersionsHandler: dictionary.GetPostgresVersionsHandlerFunc(func(params dictionary.GetPostgresVersionsParams) middleware.Responder { - return middleware.NotImplemented("operation dictionary.GetPostgresVersions has not yet been implemented") - }), - ProjectGetProjectsHandler: project.GetProjectsHandlerFunc(func(params project.GetProjectsParams) middleware.Responder { - return middleware.NotImplemented("operation project.GetProjects has not yet been implemented") - }), - SecretGetSecretsHandler: secret.GetSecretsHandlerFunc(func(params secret.GetSecretsParams) middleware.Responder { - return middleware.NotImplemented("operation secret.GetSecrets has not yet been implemented") - }), - SettingGetSettingsHandler: setting.GetSettingsHandlerFunc(func(params setting.GetSettingsParams) middleware.Responder { - return middleware.NotImplemented("operation setting.GetSettings has not yet been implemented") - }), - SystemGetVersionHandler: system.GetVersionHandlerFunc(func(params system.GetVersionParams) middleware.Responder { - return middleware.NotImplemented("operation system.GetVersion has not yet been implemented") - }), - ProjectPatchProjectsIDHandler: project.PatchProjectsIDHandlerFunc(func(params project.PatchProjectsIDParams) middleware.Responder { - return middleware.NotImplemented("operation project.PatchProjectsID has not yet been implemented") - }), - SecretPatchSecretsIDHandler: secret.PatchSecretsIDHandlerFunc(func(params secret.PatchSecretsIDParams) middleware.Responder { - return middleware.NotImplemented("operation secret.PatchSecretsID has not yet been implemented") - }), - SettingPatchSettingsNameHandler: setting.PatchSettingsNameHandlerFunc(func(params setting.PatchSettingsNameParams) middleware.Responder { - return middleware.NotImplemented("operation setting.PatchSettingsName has not yet been implemented") - }), - ClusterPostClustersHandler: cluster.PostClustersHandlerFunc(func(params cluster.PostClustersParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClusters has not yet been implemented") - }), - ClusterPostClustersIDRefreshHandler: cluster.PostClustersIDRefreshHandlerFunc(func(params cluster.PostClustersIDRefreshParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDRefresh has not yet been implemented") - }), - ClusterPostClustersIDReinitHandler: cluster.PostClustersIDReinitHandlerFunc(func(params cluster.PostClustersIDReinitParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDReinit has not yet been implemented") - }), - ClusterPostClustersIDReloadHandler: cluster.PostClustersIDReloadHandlerFunc(func(params cluster.PostClustersIDReloadParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDReload has not yet been implemented") - }), - ClusterPostClustersIDRemoveHandler: cluster.PostClustersIDRemoveHandlerFunc(func(params cluster.PostClustersIDRemoveParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDRemove has not yet been implemented") - }), - ClusterPostClustersIDRestartHandler: cluster.PostClustersIDRestartHandlerFunc(func(params cluster.PostClustersIDRestartParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDRestart has not yet been implemented") - }), - ClusterPostClustersIDStartHandler: cluster.PostClustersIDStartHandlerFunc(func(params cluster.PostClustersIDStartParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDStart has not yet been implemented") - }), - ClusterPostClustersIDStopHandler: cluster.PostClustersIDStopHandlerFunc(func(params cluster.PostClustersIDStopParams) middleware.Responder { - return middleware.NotImplemented("operation cluster.PostClustersIDStop has not yet been implemented") - }), - EnvironmentPostEnvironmentsHandler: environment.PostEnvironmentsHandlerFunc(func(params environment.PostEnvironmentsParams) middleware.Responder { - return middleware.NotImplemented("operation environment.PostEnvironments has not yet been implemented") - }), - ProjectPostProjectsHandler: project.PostProjectsHandlerFunc(func(params project.PostProjectsParams) middleware.Responder { - return middleware.NotImplemented("operation project.PostProjects has not yet been implemented") - }), - SecretPostSecretsHandler: secret.PostSecretsHandlerFunc(func(params secret.PostSecretsParams) middleware.Responder { - return middleware.NotImplemented("operation secret.PostSecrets has not yet been implemented") - }), - SettingPostSettingsHandler: setting.PostSettingsHandlerFunc(func(params setting.PostSettingsParams) middleware.Responder { - return middleware.NotImplemented("operation setting.PostSettings has not yet been implemented") - }), - } -} - -/*PgConsoleAPI API for PG Console WEB */ -type PgConsoleAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - // PlainTextConsumer registers a consumer for the following mime types: - // - plain/text - PlainTextConsumer runtime.Consumer - - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // ClusterDeleteClustersIDHandler sets the operation handler for the delete clusters ID operation - ClusterDeleteClustersIDHandler cluster.DeleteClustersIDHandler - // EnvironmentDeleteEnvironmentsIDHandler sets the operation handler for the delete environments ID operation - EnvironmentDeleteEnvironmentsIDHandler environment.DeleteEnvironmentsIDHandler - // ProjectDeleteProjectsIDHandler sets the operation handler for the delete projects ID operation - ProjectDeleteProjectsIDHandler project.DeleteProjectsIDHandler - // SecretDeleteSecretsIDHandler sets the operation handler for the delete secrets ID operation - SecretDeleteSecretsIDHandler secret.DeleteSecretsIDHandler - // ClusterDeleteServersIDHandler sets the operation handler for the delete servers ID operation - ClusterDeleteServersIDHandler cluster.DeleteServersIDHandler - // ClusterGetClustersHandler sets the operation handler for the get clusters operation - ClusterGetClustersHandler cluster.GetClustersHandler - // ClusterGetClustersDefaultNameHandler sets the operation handler for the get clusters default name operation - ClusterGetClustersDefaultNameHandler cluster.GetClustersDefaultNameHandler - // ClusterGetClustersIDHandler sets the operation handler for the get clusters ID operation - ClusterGetClustersIDHandler cluster.GetClustersIDHandler - // DictionaryGetDatabaseExtensionsHandler sets the operation handler for the get database extensions operation - DictionaryGetDatabaseExtensionsHandler dictionary.GetDatabaseExtensionsHandler - // EnvironmentGetEnvironmentsHandler sets the operation handler for the get environments operation - EnvironmentGetEnvironmentsHandler environment.GetEnvironmentsHandler - // DictionaryGetExternalDeploymentsHandler sets the operation handler for the get external deployments operation - DictionaryGetExternalDeploymentsHandler dictionary.GetExternalDeploymentsHandler - // OperationGetOperationsHandler sets the operation handler for the get operations operation - OperationGetOperationsHandler operation.GetOperationsHandler - // OperationGetOperationsIDLogHandler sets the operation handler for the get operations ID log operation - OperationGetOperationsIDLogHandler operation.GetOperationsIDLogHandler - // DictionaryGetPostgresVersionsHandler sets the operation handler for the get postgres versions operation - DictionaryGetPostgresVersionsHandler dictionary.GetPostgresVersionsHandler - // ProjectGetProjectsHandler sets the operation handler for the get projects operation - ProjectGetProjectsHandler project.GetProjectsHandler - // SecretGetSecretsHandler sets the operation handler for the get secrets operation - SecretGetSecretsHandler secret.GetSecretsHandler - // SettingGetSettingsHandler sets the operation handler for the get settings operation - SettingGetSettingsHandler setting.GetSettingsHandler - // SystemGetVersionHandler sets the operation handler for the get version operation - SystemGetVersionHandler system.GetVersionHandler - // ProjectPatchProjectsIDHandler sets the operation handler for the patch projects ID operation - ProjectPatchProjectsIDHandler project.PatchProjectsIDHandler - // SecretPatchSecretsIDHandler sets the operation handler for the patch secrets ID operation - SecretPatchSecretsIDHandler secret.PatchSecretsIDHandler - // SettingPatchSettingsNameHandler sets the operation handler for the patch settings name operation - SettingPatchSettingsNameHandler setting.PatchSettingsNameHandler - // ClusterPostClustersHandler sets the operation handler for the post clusters operation - ClusterPostClustersHandler cluster.PostClustersHandler - // ClusterPostClustersIDRefreshHandler sets the operation handler for the post clusters ID refresh operation - ClusterPostClustersIDRefreshHandler cluster.PostClustersIDRefreshHandler - // ClusterPostClustersIDReinitHandler sets the operation handler for the post clusters ID reinit operation - ClusterPostClustersIDReinitHandler cluster.PostClustersIDReinitHandler - // ClusterPostClustersIDReloadHandler sets the operation handler for the post clusters ID reload operation - ClusterPostClustersIDReloadHandler cluster.PostClustersIDReloadHandler - // ClusterPostClustersIDRemoveHandler sets the operation handler for the post clusters ID remove operation - ClusterPostClustersIDRemoveHandler cluster.PostClustersIDRemoveHandler - // ClusterPostClustersIDRestartHandler sets the operation handler for the post clusters ID restart operation - ClusterPostClustersIDRestartHandler cluster.PostClustersIDRestartHandler - // ClusterPostClustersIDStartHandler sets the operation handler for the post clusters ID start operation - ClusterPostClustersIDStartHandler cluster.PostClustersIDStartHandler - // ClusterPostClustersIDStopHandler sets the operation handler for the post clusters ID stop operation - ClusterPostClustersIDStopHandler cluster.PostClustersIDStopHandler - // EnvironmentPostEnvironmentsHandler sets the operation handler for the post environments operation - EnvironmentPostEnvironmentsHandler environment.PostEnvironmentsHandler - // ProjectPostProjectsHandler sets the operation handler for the post projects operation - ProjectPostProjectsHandler project.PostProjectsHandler - // SecretPostSecretsHandler sets the operation handler for the post secrets operation - SecretPostSecretsHandler secret.PostSecretsHandler - // SettingPostSettingsHandler sets the operation handler for the post settings operation - SettingPostSettingsHandler setting.PostSettingsHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *PgConsoleAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *PgConsoleAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *PgConsoleAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *PgConsoleAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *PgConsoleAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *PgConsoleAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *PgConsoleAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *PgConsoleAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *PgConsoleAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the PgConsoleAPI -func (o *PgConsoleAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - if o.PlainTextConsumer == nil { - unregistered = append(unregistered, "PlainTextConsumer") - } - - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.ClusterDeleteClustersIDHandler == nil { - unregistered = append(unregistered, "cluster.DeleteClustersIDHandler") - } - if o.EnvironmentDeleteEnvironmentsIDHandler == nil { - unregistered = append(unregistered, "environment.DeleteEnvironmentsIDHandler") - } - if o.ProjectDeleteProjectsIDHandler == nil { - unregistered = append(unregistered, "project.DeleteProjectsIDHandler") - } - if o.SecretDeleteSecretsIDHandler == nil { - unregistered = append(unregistered, "secret.DeleteSecretsIDHandler") - } - if o.ClusterDeleteServersIDHandler == nil { - unregistered = append(unregistered, "cluster.DeleteServersIDHandler") - } - if o.ClusterGetClustersHandler == nil { - unregistered = append(unregistered, "cluster.GetClustersHandler") - } - if o.ClusterGetClustersDefaultNameHandler == nil { - unregistered = append(unregistered, "cluster.GetClustersDefaultNameHandler") - } - if o.ClusterGetClustersIDHandler == nil { - unregistered = append(unregistered, "cluster.GetClustersIDHandler") - } - if o.DictionaryGetDatabaseExtensionsHandler == nil { - unregistered = append(unregistered, "dictionary.GetDatabaseExtensionsHandler") - } - if o.EnvironmentGetEnvironmentsHandler == nil { - unregistered = append(unregistered, "environment.GetEnvironmentsHandler") - } - if o.DictionaryGetExternalDeploymentsHandler == nil { - unregistered = append(unregistered, "dictionary.GetExternalDeploymentsHandler") - } - if o.OperationGetOperationsHandler == nil { - unregistered = append(unregistered, "operation.GetOperationsHandler") - } - if o.OperationGetOperationsIDLogHandler == nil { - unregistered = append(unregistered, "operation.GetOperationsIDLogHandler") - } - if o.DictionaryGetPostgresVersionsHandler == nil { - unregistered = append(unregistered, "dictionary.GetPostgresVersionsHandler") - } - if o.ProjectGetProjectsHandler == nil { - unregistered = append(unregistered, "project.GetProjectsHandler") - } - if o.SecretGetSecretsHandler == nil { - unregistered = append(unregistered, "secret.GetSecretsHandler") - } - if o.SettingGetSettingsHandler == nil { - unregistered = append(unregistered, "setting.GetSettingsHandler") - } - if o.SystemGetVersionHandler == nil { - unregistered = append(unregistered, "system.GetVersionHandler") - } - if o.ProjectPatchProjectsIDHandler == nil { - unregistered = append(unregistered, "project.PatchProjectsIDHandler") - } - if o.SecretPatchSecretsIDHandler == nil { - unregistered = append(unregistered, "secret.PatchSecretsIDHandler") - } - if o.SettingPatchSettingsNameHandler == nil { - unregistered = append(unregistered, "setting.PatchSettingsNameHandler") - } - if o.ClusterPostClustersHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersHandler") - } - if o.ClusterPostClustersIDRefreshHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDRefreshHandler") - } - if o.ClusterPostClustersIDReinitHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDReinitHandler") - } - if o.ClusterPostClustersIDReloadHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDReloadHandler") - } - if o.ClusterPostClustersIDRemoveHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDRemoveHandler") - } - if o.ClusterPostClustersIDRestartHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDRestartHandler") - } - if o.ClusterPostClustersIDStartHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDStartHandler") - } - if o.ClusterPostClustersIDStopHandler == nil { - unregistered = append(unregistered, "cluster.PostClustersIDStopHandler") - } - if o.EnvironmentPostEnvironmentsHandler == nil { - unregistered = append(unregistered, "environment.PostEnvironmentsHandler") - } - if o.ProjectPostProjectsHandler == nil { - unregistered = append(unregistered, "project.PostProjectsHandler") - } - if o.SecretPostSecretsHandler == nil { - unregistered = append(unregistered, "secret.PostSecretsHandler") - } - if o.SettingPostSettingsHandler == nil { - unregistered = append(unregistered, "setting.PostSettingsHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *PgConsoleAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *PgConsoleAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *PgConsoleAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *PgConsoleAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - case "plain/text": - result["plain/text"] = o.PlainTextConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *PgConsoleAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *PgConsoleAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the pg console API -func (o *PgConsoleAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *PgConsoleAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/clusters/{id}"] = cluster.NewDeleteClustersID(o.context, o.ClusterDeleteClustersIDHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/environments/{id}"] = environment.NewDeleteEnvironmentsID(o.context, o.EnvironmentDeleteEnvironmentsIDHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/projects/{id}"] = project.NewDeleteProjectsID(o.context, o.ProjectDeleteProjectsIDHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/secrets/{id}"] = secret.NewDeleteSecretsID(o.context, o.SecretDeleteSecretsIDHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/servers/{id}"] = cluster.NewDeleteServersID(o.context, o.ClusterDeleteServersIDHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/clusters"] = cluster.NewGetClusters(o.context, o.ClusterGetClustersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/clusters/default_name"] = cluster.NewGetClustersDefaultName(o.context, o.ClusterGetClustersDefaultNameHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/clusters/{id}"] = cluster.NewGetClustersID(o.context, o.ClusterGetClustersIDHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/database/extensions"] = dictionary.NewGetDatabaseExtensions(o.context, o.DictionaryGetDatabaseExtensionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/environments"] = environment.NewGetEnvironments(o.context, o.EnvironmentGetEnvironmentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/external/deployments"] = dictionary.NewGetExternalDeployments(o.context, o.DictionaryGetExternalDeploymentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/operations"] = operation.NewGetOperations(o.context, o.OperationGetOperationsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/operations/{id}/log"] = operation.NewGetOperationsIDLog(o.context, o.OperationGetOperationsIDLogHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/postgres_versions"] = dictionary.NewGetPostgresVersions(o.context, o.DictionaryGetPostgresVersionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/projects"] = project.NewGetProjects(o.context, o.ProjectGetProjectsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/secrets"] = secret.NewGetSecrets(o.context, o.SecretGetSecretsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/settings"] = setting.NewGetSettings(o.context, o.SettingGetSettingsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/version"] = system.NewGetVersion(o.context, o.SystemGetVersionHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/projects/{id}"] = project.NewPatchProjectsID(o.context, o.ProjectPatchProjectsIDHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/secrets/{id}"] = secret.NewPatchSecretsID(o.context, o.SecretPatchSecretsIDHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/settings/{name}"] = setting.NewPatchSettingsName(o.context, o.SettingPatchSettingsNameHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters"] = cluster.NewPostClusters(o.context, o.ClusterPostClustersHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/refresh"] = cluster.NewPostClustersIDRefresh(o.context, o.ClusterPostClustersIDRefreshHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/reinit"] = cluster.NewPostClustersIDReinit(o.context, o.ClusterPostClustersIDReinitHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/reload"] = cluster.NewPostClustersIDReload(o.context, o.ClusterPostClustersIDReloadHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/remove"] = cluster.NewPostClustersIDRemove(o.context, o.ClusterPostClustersIDRemoveHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/restart"] = cluster.NewPostClustersIDRestart(o.context, o.ClusterPostClustersIDRestartHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/start"] = cluster.NewPostClustersIDStart(o.context, o.ClusterPostClustersIDStartHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/clusters/{id}/stop"] = cluster.NewPostClustersIDStop(o.context, o.ClusterPostClustersIDStopHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/environments"] = environment.NewPostEnvironments(o.context, o.EnvironmentPostEnvironmentsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/projects"] = project.NewPostProjects(o.context, o.ProjectPostProjectsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/secrets"] = secret.NewPostSecrets(o.context, o.SecretPostSecretsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/settings"] = setting.NewPostSettings(o.context, o.SettingPostSettingsHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *PgConsoleAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *PgConsoleAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *PgConsoleAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *PgConsoleAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *PgConsoleAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[method][path] = builder(h) - } -} diff --git a/console/service/restapi/operations/project/delete_projects_id.go b/console/service/restapi/operations/project/delete_projects_id.go deleted file mode 100644 index dbe6a80a7..000000000 --- a/console/service/restapi/operations/project/delete_projects_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteProjectsIDHandlerFunc turns a function with the right signature into a delete projects ID handler -type DeleteProjectsIDHandlerFunc func(DeleteProjectsIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteProjectsIDHandlerFunc) Handle(params DeleteProjectsIDParams) middleware.Responder { - return fn(params) -} - -// DeleteProjectsIDHandler interface for that can handle valid delete projects ID params -type DeleteProjectsIDHandler interface { - Handle(DeleteProjectsIDParams) middleware.Responder -} - -// NewDeleteProjectsID creates a new http.Handler for the delete projects ID operation -func NewDeleteProjectsID(ctx *middleware.Context, handler DeleteProjectsIDHandler) *DeleteProjectsID { - return &DeleteProjectsID{Context: ctx, Handler: handler} -} - -/* - DeleteProjectsID swagger:route DELETE /projects/{id} project deleteProjectsId - -Delete project -*/ -type DeleteProjectsID struct { - Context *middleware.Context - Handler DeleteProjectsIDHandler -} - -func (o *DeleteProjectsID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteProjectsIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/project/delete_projects_id_parameters.go b/console/service/restapi/operations/project/delete_projects_id_parameters.go deleted file mode 100644 index 3953d6c4d..000000000 --- a/console/service/restapi/operations/project/delete_projects_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewDeleteProjectsIDParams creates a new DeleteProjectsIDParams object -// -// There are no default values defined in the spec. -func NewDeleteProjectsIDParams() DeleteProjectsIDParams { - - return DeleteProjectsIDParams{} -} - -// DeleteProjectsIDParams contains all the bound params for the delete projects ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteProjectsID -type DeleteProjectsIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteProjectsIDParams() beforehand. -func (o *DeleteProjectsIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteProjectsIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/project/delete_projects_id_responses.go b/console/service/restapi/operations/project/delete_projects_id_responses.go deleted file mode 100644 index d5ab8e5bb..000000000 --- a/console/service/restapi/operations/project/delete_projects_id_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// DeleteProjectsIDNoContentCode is the HTTP code returned for type DeleteProjectsIDNoContent -const DeleteProjectsIDNoContentCode int = 204 - -/* -DeleteProjectsIDNoContent OK - -swagger:response deleteProjectsIdNoContent -*/ -type DeleteProjectsIDNoContent struct { -} - -// NewDeleteProjectsIDNoContent creates DeleteProjectsIDNoContent with default headers values -func NewDeleteProjectsIDNoContent() *DeleteProjectsIDNoContent { - - return &DeleteProjectsIDNoContent{} -} - -// WriteResponse to the client -func (o *DeleteProjectsIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteProjectsIDBadRequestCode is the HTTP code returned for type DeleteProjectsIDBadRequest -const DeleteProjectsIDBadRequestCode int = 400 - -/* -DeleteProjectsIDBadRequest Error - -swagger:response deleteProjectsIdBadRequest -*/ -type DeleteProjectsIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewDeleteProjectsIDBadRequest creates DeleteProjectsIDBadRequest with default headers values -func NewDeleteProjectsIDBadRequest() *DeleteProjectsIDBadRequest { - - return &DeleteProjectsIDBadRequest{} -} - -// WithPayload adds the payload to the delete projects Id bad request response -func (o *DeleteProjectsIDBadRequest) WithPayload(payload *models.ResponseError) *DeleteProjectsIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete projects Id bad request response -func (o *DeleteProjectsIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProjectsIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/project/delete_projects_id_urlbuilder.go b/console/service/restapi/operations/project/delete_projects_id_urlbuilder.go deleted file mode 100644 index 1f94fa20e..000000000 --- a/console/service/restapi/operations/project/delete_projects_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// DeleteProjectsIDURL generates an URL for the delete projects ID operation -type DeleteProjectsIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteProjectsIDURL) WithBasePath(bp string) *DeleteProjectsIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteProjectsIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteProjectsIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/projects/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteProjectsIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteProjectsIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteProjectsIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteProjectsIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteProjectsIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteProjectsIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteProjectsIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/project/get_projects.go b/console/service/restapi/operations/project/get_projects.go deleted file mode 100644 index 02ecdcd1a..000000000 --- a/console/service/restapi/operations/project/get_projects.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetProjectsHandlerFunc turns a function with the right signature into a get projects handler -type GetProjectsHandlerFunc func(GetProjectsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetProjectsHandlerFunc) Handle(params GetProjectsParams) middleware.Responder { - return fn(params) -} - -// GetProjectsHandler interface for that can handle valid get projects params -type GetProjectsHandler interface { - Handle(GetProjectsParams) middleware.Responder -} - -// NewGetProjects creates a new http.Handler for the get projects operation -func NewGetProjects(ctx *middleware.Context, handler GetProjectsHandler) *GetProjects { - return &GetProjects{Context: ctx, Handler: handler} -} - -/* - GetProjects swagger:route GET /projects project getProjects - -Get projects list -*/ -type GetProjects struct { - Context *middleware.Context - Handler GetProjectsHandler -} - -func (o *GetProjects) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetProjectsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/project/get_projects_parameters.go b/console/service/restapi/operations/project/get_projects_parameters.go deleted file mode 100644 index b03004fd7..000000000 --- a/console/service/restapi/operations/project/get_projects_parameters.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetProjectsParams creates a new GetProjectsParams object -// -// There are no default values defined in the spec. -func NewGetProjectsParams() GetProjectsParams { - - return GetProjectsParams{} -} - -// GetProjectsParams contains all the bound params for the get projects operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetProjects -type GetProjectsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetProjectsParams() beforehand. -func (o *GetProjectsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetProjectsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetProjectsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/console/service/restapi/operations/project/get_projects_responses.go b/console/service/restapi/operations/project/get_projects_responses.go deleted file mode 100644 index 93aedd3bf..000000000 --- a/console/service/restapi/operations/project/get_projects_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetProjectsOKCode is the HTTP code returned for type GetProjectsOK -const GetProjectsOKCode int = 200 - -/* -GetProjectsOK OK - -swagger:response getProjectsOK -*/ -type GetProjectsOK struct { - - /* - In: Body - */ - Payload *models.ResponseProjectsList `json:"body,omitempty"` -} - -// NewGetProjectsOK creates GetProjectsOK with default headers values -func NewGetProjectsOK() *GetProjectsOK { - - return &GetProjectsOK{} -} - -// WithPayload adds the payload to the get projects o k response -func (o *GetProjectsOK) WithPayload(payload *models.ResponseProjectsList) *GetProjectsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get projects o k response -func (o *GetProjectsOK) SetPayload(payload *models.ResponseProjectsList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetProjectsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetProjectsBadRequestCode is the HTTP code returned for type GetProjectsBadRequest -const GetProjectsBadRequestCode int = 400 - -/* -GetProjectsBadRequest Error - -swagger:response getProjectsBadRequest -*/ -type GetProjectsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetProjectsBadRequest creates GetProjectsBadRequest with default headers values -func NewGetProjectsBadRequest() *GetProjectsBadRequest { - - return &GetProjectsBadRequest{} -} - -// WithPayload adds the payload to the get projects bad request response -func (o *GetProjectsBadRequest) WithPayload(payload *models.ResponseError) *GetProjectsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get projects bad request response -func (o *GetProjectsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetProjectsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/project/get_projects_urlbuilder.go b/console/service/restapi/operations/project/get_projects_urlbuilder.go deleted file mode 100644 index 933286efe..000000000 --- a/console/service/restapi/operations/project/get_projects_urlbuilder.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetProjectsURL generates an URL for the get projects operation -type GetProjectsURL struct { - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetProjectsURL) WithBasePath(bp string) *GetProjectsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetProjectsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetProjectsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/projects" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetProjectsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetProjectsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetProjectsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetProjectsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetProjectsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetProjectsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/project/patch_projects_id.go b/console/service/restapi/operations/project/patch_projects_id.go deleted file mode 100644 index d8573af8e..000000000 --- a/console/service/restapi/operations/project/patch_projects_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchProjectsIDHandlerFunc turns a function with the right signature into a patch projects ID handler -type PatchProjectsIDHandlerFunc func(PatchProjectsIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchProjectsIDHandlerFunc) Handle(params PatchProjectsIDParams) middleware.Responder { - return fn(params) -} - -// PatchProjectsIDHandler interface for that can handle valid patch projects ID params -type PatchProjectsIDHandler interface { - Handle(PatchProjectsIDParams) middleware.Responder -} - -// NewPatchProjectsID creates a new http.Handler for the patch projects ID operation -func NewPatchProjectsID(ctx *middleware.Context, handler PatchProjectsIDHandler) *PatchProjectsID { - return &PatchProjectsID{Context: ctx, Handler: handler} -} - -/* - PatchProjectsID swagger:route PATCH /projects/{id} project patchProjectsId - -Change project -*/ -type PatchProjectsID struct { - Context *middleware.Context - Handler PatchProjectsIDHandler -} - -func (o *PatchProjectsID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchProjectsIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/project/patch_projects_id_parameters.go b/console/service/restapi/operations/project/patch_projects_id_parameters.go deleted file mode 100644 index d454b9e17..000000000 --- a/console/service/restapi/operations/project/patch_projects_id_parameters.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPatchProjectsIDParams creates a new PatchProjectsIDParams object -// -// There are no default values defined in the spec. -func NewPatchProjectsIDParams() PatchProjectsIDParams { - - return PatchProjectsIDParams{} -} - -// PatchProjectsIDParams contains all the bound params for the patch projects ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters PatchProjectsID -type PatchProjectsIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestProjectPatch - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchProjectsIDParams() beforehand. -func (o *PatchProjectsIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestProjectPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchProjectsIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/project/patch_projects_id_responses.go b/console/service/restapi/operations/project/patch_projects_id_responses.go deleted file mode 100644 index 1c042a293..000000000 --- a/console/service/restapi/operations/project/patch_projects_id_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PatchProjectsIDOKCode is the HTTP code returned for type PatchProjectsIDOK -const PatchProjectsIDOKCode int = 200 - -/* -PatchProjectsIDOK OK - -swagger:response patchProjectsIdOK -*/ -type PatchProjectsIDOK struct { - - /* - In: Body - */ - Payload *models.ResponseProject `json:"body,omitempty"` -} - -// NewPatchProjectsIDOK creates PatchProjectsIDOK with default headers values -func NewPatchProjectsIDOK() *PatchProjectsIDOK { - - return &PatchProjectsIDOK{} -} - -// WithPayload adds the payload to the patch projects Id o k response -func (o *PatchProjectsIDOK) WithPayload(payload *models.ResponseProject) *PatchProjectsIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch projects Id o k response -func (o *PatchProjectsIDOK) SetPayload(payload *models.ResponseProject) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchProjectsIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchProjectsIDBadRequestCode is the HTTP code returned for type PatchProjectsIDBadRequest -const PatchProjectsIDBadRequestCode int = 400 - -/* -PatchProjectsIDBadRequest Error - -swagger:response patchProjectsIdBadRequest -*/ -type PatchProjectsIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPatchProjectsIDBadRequest creates PatchProjectsIDBadRequest with default headers values -func NewPatchProjectsIDBadRequest() *PatchProjectsIDBadRequest { - - return &PatchProjectsIDBadRequest{} -} - -// WithPayload adds the payload to the patch projects Id bad request response -func (o *PatchProjectsIDBadRequest) WithPayload(payload *models.ResponseError) *PatchProjectsIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch projects Id bad request response -func (o *PatchProjectsIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchProjectsIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/project/patch_projects_id_urlbuilder.go b/console/service/restapi/operations/project/patch_projects_id_urlbuilder.go deleted file mode 100644 index 1c9230303..000000000 --- a/console/service/restapi/operations/project/patch_projects_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PatchProjectsIDURL generates an URL for the patch projects ID operation -type PatchProjectsIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchProjectsIDURL) WithBasePath(bp string) *PatchProjectsIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchProjectsIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchProjectsIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/projects/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchProjectsIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchProjectsIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchProjectsIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchProjectsIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchProjectsIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchProjectsIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchProjectsIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/project/post_projects.go b/console/service/restapi/operations/project/post_projects.go deleted file mode 100644 index a958178da..000000000 --- a/console/service/restapi/operations/project/post_projects.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostProjectsHandlerFunc turns a function with the right signature into a post projects handler -type PostProjectsHandlerFunc func(PostProjectsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostProjectsHandlerFunc) Handle(params PostProjectsParams) middleware.Responder { - return fn(params) -} - -// PostProjectsHandler interface for that can handle valid post projects params -type PostProjectsHandler interface { - Handle(PostProjectsParams) middleware.Responder -} - -// NewPostProjects creates a new http.Handler for the post projects operation -func NewPostProjects(ctx *middleware.Context, handler PostProjectsHandler) *PostProjects { - return &PostProjects{Context: ctx, Handler: handler} -} - -/* - PostProjects swagger:route POST /projects project postProjects - -Create new project -*/ -type PostProjects struct { - Context *middleware.Context - Handler PostProjectsHandler -} - -func (o *PostProjects) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostProjectsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/project/post_projects_parameters.go b/console/service/restapi/operations/project/post_projects_parameters.go deleted file mode 100644 index e3cf204fa..000000000 --- a/console/service/restapi/operations/project/post_projects_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPostProjectsParams creates a new PostProjectsParams object -// -// There are no default values defined in the spec. -func NewPostProjectsParams() PostProjectsParams { - - return PostProjectsParams{} -} - -// PostProjectsParams contains all the bound params for the post projects operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostProjects -type PostProjectsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestProjectCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostProjectsParams() beforehand. -func (o *PostProjectsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestProjectCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/project/post_projects_responses.go b/console/service/restapi/operations/project/post_projects_responses.go deleted file mode 100644 index 505ea560b..000000000 --- a/console/service/restapi/operations/project/post_projects_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostProjectsOKCode is the HTTP code returned for type PostProjectsOK -const PostProjectsOKCode int = 200 - -/* -PostProjectsOK OK - -swagger:response postProjectsOK -*/ -type PostProjectsOK struct { - - /* - In: Body - */ - Payload *models.ResponseProject `json:"body,omitempty"` -} - -// NewPostProjectsOK creates PostProjectsOK with default headers values -func NewPostProjectsOK() *PostProjectsOK { - - return &PostProjectsOK{} -} - -// WithPayload adds the payload to the post projects o k response -func (o *PostProjectsOK) WithPayload(payload *models.ResponseProject) *PostProjectsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post projects o k response -func (o *PostProjectsOK) SetPayload(payload *models.ResponseProject) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostProjectsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostProjectsBadRequestCode is the HTTP code returned for type PostProjectsBadRequest -const PostProjectsBadRequestCode int = 400 - -/* -PostProjectsBadRequest Error - -swagger:response postProjectsBadRequest -*/ -type PostProjectsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostProjectsBadRequest creates PostProjectsBadRequest with default headers values -func NewPostProjectsBadRequest() *PostProjectsBadRequest { - - return &PostProjectsBadRequest{} -} - -// WithPayload adds the payload to the post projects bad request response -func (o *PostProjectsBadRequest) WithPayload(payload *models.ResponseError) *PostProjectsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post projects bad request response -func (o *PostProjectsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostProjectsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/project/post_projects_urlbuilder.go b/console/service/restapi/operations/project/post_projects_urlbuilder.go deleted file mode 100644 index 3d9707909..000000000 --- a/console/service/restapi/operations/project/post_projects_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package project - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostProjectsURL generates an URL for the post projects operation -type PostProjectsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostProjectsURL) WithBasePath(bp string) *PostProjectsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostProjectsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostProjectsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/projects" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostProjectsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostProjectsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostProjectsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostProjectsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostProjectsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostProjectsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/secret/delete_secrets_id.go b/console/service/restapi/operations/secret/delete_secrets_id.go deleted file mode 100644 index 7ef6ad789..000000000 --- a/console/service/restapi/operations/secret/delete_secrets_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteSecretsIDHandlerFunc turns a function with the right signature into a delete secrets ID handler -type DeleteSecretsIDHandlerFunc func(DeleteSecretsIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteSecretsIDHandlerFunc) Handle(params DeleteSecretsIDParams) middleware.Responder { - return fn(params) -} - -// DeleteSecretsIDHandler interface for that can handle valid delete secrets ID params -type DeleteSecretsIDHandler interface { - Handle(DeleteSecretsIDParams) middleware.Responder -} - -// NewDeleteSecretsID creates a new http.Handler for the delete secrets ID operation -func NewDeleteSecretsID(ctx *middleware.Context, handler DeleteSecretsIDHandler) *DeleteSecretsID { - return &DeleteSecretsID{Context: ctx, Handler: handler} -} - -/* - DeleteSecretsID swagger:route DELETE /secrets/{id} secret deleteSecretsId - -Delete secret -*/ -type DeleteSecretsID struct { - Context *middleware.Context - Handler DeleteSecretsIDHandler -} - -func (o *DeleteSecretsID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteSecretsIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/secret/delete_secrets_id_parameters.go b/console/service/restapi/operations/secret/delete_secrets_id_parameters.go deleted file mode 100644 index e3fc672c7..000000000 --- a/console/service/restapi/operations/secret/delete_secrets_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewDeleteSecretsIDParams creates a new DeleteSecretsIDParams object -// -// There are no default values defined in the spec. -func NewDeleteSecretsIDParams() DeleteSecretsIDParams { - - return DeleteSecretsIDParams{} -} - -// DeleteSecretsIDParams contains all the bound params for the delete secrets ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteSecretsID -type DeleteSecretsIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteSecretsIDParams() beforehand. -func (o *DeleteSecretsIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteSecretsIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/secret/delete_secrets_id_responses.go b/console/service/restapi/operations/secret/delete_secrets_id_responses.go deleted file mode 100644 index c91f29e5d..000000000 --- a/console/service/restapi/operations/secret/delete_secrets_id_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// DeleteSecretsIDNoContentCode is the HTTP code returned for type DeleteSecretsIDNoContent -const DeleteSecretsIDNoContentCode int = 204 - -/* -DeleteSecretsIDNoContent OK - -swagger:response deleteSecretsIdNoContent -*/ -type DeleteSecretsIDNoContent struct { -} - -// NewDeleteSecretsIDNoContent creates DeleteSecretsIDNoContent with default headers values -func NewDeleteSecretsIDNoContent() *DeleteSecretsIDNoContent { - - return &DeleteSecretsIDNoContent{} -} - -// WriteResponse to the client -func (o *DeleteSecretsIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteSecretsIDBadRequestCode is the HTTP code returned for type DeleteSecretsIDBadRequest -const DeleteSecretsIDBadRequestCode int = 400 - -/* -DeleteSecretsIDBadRequest Error - -swagger:response deleteSecretsIdBadRequest -*/ -type DeleteSecretsIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewDeleteSecretsIDBadRequest creates DeleteSecretsIDBadRequest with default headers values -func NewDeleteSecretsIDBadRequest() *DeleteSecretsIDBadRequest { - - return &DeleteSecretsIDBadRequest{} -} - -// WithPayload adds the payload to the delete secrets Id bad request response -func (o *DeleteSecretsIDBadRequest) WithPayload(payload *models.ResponseError) *DeleteSecretsIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete secrets Id bad request response -func (o *DeleteSecretsIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSecretsIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/secret/delete_secrets_id_urlbuilder.go b/console/service/restapi/operations/secret/delete_secrets_id_urlbuilder.go deleted file mode 100644 index a4fc9de64..000000000 --- a/console/service/restapi/operations/secret/delete_secrets_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// DeleteSecretsIDURL generates an URL for the delete secrets ID operation -type DeleteSecretsIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteSecretsIDURL) WithBasePath(bp string) *DeleteSecretsIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteSecretsIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteSecretsIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/secrets/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteSecretsIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteSecretsIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteSecretsIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteSecretsIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteSecretsIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteSecretsIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteSecretsIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/secret/get_secrets.go b/console/service/restapi/operations/secret/get_secrets.go deleted file mode 100644 index 7f261765a..000000000 --- a/console/service/restapi/operations/secret/get_secrets.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetSecretsHandlerFunc turns a function with the right signature into a get secrets handler -type GetSecretsHandlerFunc func(GetSecretsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetSecretsHandlerFunc) Handle(params GetSecretsParams) middleware.Responder { - return fn(params) -} - -// GetSecretsHandler interface for that can handle valid get secrets params -type GetSecretsHandler interface { - Handle(GetSecretsParams) middleware.Responder -} - -// NewGetSecrets creates a new http.Handler for the get secrets operation -func NewGetSecrets(ctx *middleware.Context, handler GetSecretsHandler) *GetSecrets { - return &GetSecrets{Context: ctx, Handler: handler} -} - -/* - GetSecrets swagger:route GET /secrets secret getSecrets - -Get secrets list -*/ -type GetSecrets struct { - Context *middleware.Context - Handler GetSecretsHandler -} - -func (o *GetSecrets) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetSecretsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/secret/get_secrets_parameters.go b/console/service/restapi/operations/secret/get_secrets_parameters.go deleted file mode 100644 index c78f008f3..000000000 --- a/console/service/restapi/operations/secret/get_secrets_parameters.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetSecretsParams creates a new GetSecretsParams object -// -// There are no default values defined in the spec. -func NewGetSecretsParams() GetSecretsParams { - - return GetSecretsParams{} -} - -// GetSecretsParams contains all the bound params for the get secrets operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetSecrets -type GetSecretsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Limit *int64 - /*Filter by name - In: query - */ - Name *string - /* - In: query - */ - Offset *int64 - /* - Required: true - In: query - */ - ProjectID int64 - /*Sort by fields. Example: sort_by=id,name,-type,created_at,updated_at - In: query - */ - SortBy *string - /*Filter by type - In: query - */ - Type *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetSecretsParams() beforehand. -func (o *GetSecretsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qName, qhkName, _ := qs.GetOK("name") - if err := o.bindName(qName, qhkName, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qProjectID, qhkProjectID, _ := qs.GetOK("project_id") - if err := o.bindProjectID(qProjectID, qhkProjectID, route.Formats); err != nil { - res = append(res, err) - } - - qSortBy, qhkSortBy, _ := qs.GetOK("sort_by") - if err := o.bindSortBy(qSortBy, qhkSortBy, route.Formats); err != nil { - res = append(res, err) - } - - qType, qhkType, _ := qs.GetOK("type") - if err := o.bindType(qType, qhkType, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetSecretsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindName binds and validates parameter Name from query. -func (o *GetSecretsParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Name = &raw - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetSecretsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindProjectID binds and validates parameter ProjectID from query. -func (o *GetSecretsParams) bindProjectID(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("project_id", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("project_id", "query", raw); err != nil { - return err - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("project_id", "query", "int64", raw) - } - o.ProjectID = value - - return nil -} - -// bindSortBy binds and validates parameter SortBy from query. -func (o *GetSecretsParams) bindSortBy(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.SortBy = &raw - - return nil -} - -// bindType binds and validates parameter Type from query. -func (o *GetSecretsParams) bindType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Type = &raw - - return nil -} diff --git a/console/service/restapi/operations/secret/get_secrets_responses.go b/console/service/restapi/operations/secret/get_secrets_responses.go deleted file mode 100644 index 77aab0ece..000000000 --- a/console/service/restapi/operations/secret/get_secrets_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetSecretsOKCode is the HTTP code returned for type GetSecretsOK -const GetSecretsOKCode int = 200 - -/* -GetSecretsOK OK - -swagger:response getSecretsOK -*/ -type GetSecretsOK struct { - - /* - In: Body - */ - Payload *models.ResponseSecretInfoList `json:"body,omitempty"` -} - -// NewGetSecretsOK creates GetSecretsOK with default headers values -func NewGetSecretsOK() *GetSecretsOK { - - return &GetSecretsOK{} -} - -// WithPayload adds the payload to the get secrets o k response -func (o *GetSecretsOK) WithPayload(payload *models.ResponseSecretInfoList) *GetSecretsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get secrets o k response -func (o *GetSecretsOK) SetPayload(payload *models.ResponseSecretInfoList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetSecretsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetSecretsBadRequestCode is the HTTP code returned for type GetSecretsBadRequest -const GetSecretsBadRequestCode int = 400 - -/* -GetSecretsBadRequest Error - -swagger:response getSecretsBadRequest -*/ -type GetSecretsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetSecretsBadRequest creates GetSecretsBadRequest with default headers values -func NewGetSecretsBadRequest() *GetSecretsBadRequest { - - return &GetSecretsBadRequest{} -} - -// WithPayload adds the payload to the get secrets bad request response -func (o *GetSecretsBadRequest) WithPayload(payload *models.ResponseError) *GetSecretsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get secrets bad request response -func (o *GetSecretsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetSecretsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/secret/get_secrets_urlbuilder.go b/console/service/restapi/operations/secret/get_secrets_urlbuilder.go deleted file mode 100644 index f337fbcf1..000000000 --- a/console/service/restapi/operations/secret/get_secrets_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetSecretsURL generates an URL for the get secrets operation -type GetSecretsURL struct { - Limit *int64 - Name *string - Offset *int64 - ProjectID int64 - SortBy *string - Type *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetSecretsURL) WithBasePath(bp string) *GetSecretsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetSecretsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetSecretsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/secrets" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var nameQ string - if o.Name != nil { - nameQ = *o.Name - } - if nameQ != "" { - qs.Set("name", nameQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - projectIDQ := swag.FormatInt64(o.ProjectID) - if projectIDQ != "" { - qs.Set("project_id", projectIDQ) - } - - var sortByQ string - if o.SortBy != nil { - sortByQ = *o.SortBy - } - if sortByQ != "" { - qs.Set("sort_by", sortByQ) - } - - var typeVarQ string - if o.Type != nil { - typeVarQ = *o.Type - } - if typeVarQ != "" { - qs.Set("type", typeVarQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetSecretsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetSecretsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetSecretsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetSecretsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetSecretsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetSecretsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/secret/patch_secrets_id.go b/console/service/restapi/operations/secret/patch_secrets_id.go deleted file mode 100644 index e9b3aea58..000000000 --- a/console/service/restapi/operations/secret/patch_secrets_id.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchSecretsIDHandlerFunc turns a function with the right signature into a patch secrets ID handler -type PatchSecretsIDHandlerFunc func(PatchSecretsIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchSecretsIDHandlerFunc) Handle(params PatchSecretsIDParams) middleware.Responder { - return fn(params) -} - -// PatchSecretsIDHandler interface for that can handle valid patch secrets ID params -type PatchSecretsIDHandler interface { - Handle(PatchSecretsIDParams) middleware.Responder -} - -// NewPatchSecretsID creates a new http.Handler for the patch secrets ID operation -func NewPatchSecretsID(ctx *middleware.Context, handler PatchSecretsIDHandler) *PatchSecretsID { - return &PatchSecretsID{Context: ctx, Handler: handler} -} - -/* - PatchSecretsID swagger:route PATCH /secrets/{id} secret patchSecretsId - -Change secret -*/ -type PatchSecretsID struct { - Context *middleware.Context - Handler PatchSecretsIDHandler -} - -func (o *PatchSecretsID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchSecretsIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/secret/patch_secrets_id_parameters.go b/console/service/restapi/operations/secret/patch_secrets_id_parameters.go deleted file mode 100644 index 00ac16952..000000000 --- a/console/service/restapi/operations/secret/patch_secrets_id_parameters.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPatchSecretsIDParams creates a new PatchSecretsIDParams object -// -// There are no default values defined in the spec. -func NewPatchSecretsIDParams() PatchSecretsIDParams { - - return PatchSecretsIDParams{} -} - -// PatchSecretsIDParams contains all the bound params for the patch secrets ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters PatchSecretsID -type PatchSecretsIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestSecretPatch - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchSecretsIDParams() beforehand. -func (o *PatchSecretsIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestSecretPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchSecretsIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/console/service/restapi/operations/secret/patch_secrets_id_responses.go b/console/service/restapi/operations/secret/patch_secrets_id_responses.go deleted file mode 100644 index 41c1b3f5a..000000000 --- a/console/service/restapi/operations/secret/patch_secrets_id_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PatchSecretsIDOKCode is the HTTP code returned for type PatchSecretsIDOK -const PatchSecretsIDOKCode int = 200 - -/* -PatchSecretsIDOK OK - -swagger:response patchSecretsIdOK -*/ -type PatchSecretsIDOK struct { - - /* - In: Body - */ - Payload *models.ResponseSecretInfo `json:"body,omitempty"` -} - -// NewPatchSecretsIDOK creates PatchSecretsIDOK with default headers values -func NewPatchSecretsIDOK() *PatchSecretsIDOK { - - return &PatchSecretsIDOK{} -} - -// WithPayload adds the payload to the patch secrets Id o k response -func (o *PatchSecretsIDOK) WithPayload(payload *models.ResponseSecretInfo) *PatchSecretsIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch secrets Id o k response -func (o *PatchSecretsIDOK) SetPayload(payload *models.ResponseSecretInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchSecretsIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchSecretsIDBadRequestCode is the HTTP code returned for type PatchSecretsIDBadRequest -const PatchSecretsIDBadRequestCode int = 400 - -/* -PatchSecretsIDBadRequest Error - -swagger:response patchSecretsIdBadRequest -*/ -type PatchSecretsIDBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPatchSecretsIDBadRequest creates PatchSecretsIDBadRequest with default headers values -func NewPatchSecretsIDBadRequest() *PatchSecretsIDBadRequest { - - return &PatchSecretsIDBadRequest{} -} - -// WithPayload adds the payload to the patch secrets Id bad request response -func (o *PatchSecretsIDBadRequest) WithPayload(payload *models.ResponseError) *PatchSecretsIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch secrets Id bad request response -func (o *PatchSecretsIDBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchSecretsIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/secret/patch_secrets_id_urlbuilder.go b/console/service/restapi/operations/secret/patch_secrets_id_urlbuilder.go deleted file mode 100644 index ead2dfecc..000000000 --- a/console/service/restapi/operations/secret/patch_secrets_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PatchSecretsIDURL generates an URL for the patch secrets ID operation -type PatchSecretsIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchSecretsIDURL) WithBasePath(bp string) *PatchSecretsIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchSecretsIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchSecretsIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/secrets/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchSecretsIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchSecretsIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchSecretsIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchSecretsIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchSecretsIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchSecretsIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchSecretsIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/secret/post_secrets.go b/console/service/restapi/operations/secret/post_secrets.go deleted file mode 100644 index 13d9866a5..000000000 --- a/console/service/restapi/operations/secret/post_secrets.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostSecretsHandlerFunc turns a function with the right signature into a post secrets handler -type PostSecretsHandlerFunc func(PostSecretsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostSecretsHandlerFunc) Handle(params PostSecretsParams) middleware.Responder { - return fn(params) -} - -// PostSecretsHandler interface for that can handle valid post secrets params -type PostSecretsHandler interface { - Handle(PostSecretsParams) middleware.Responder -} - -// NewPostSecrets creates a new http.Handler for the post secrets operation -func NewPostSecrets(ctx *middleware.Context, handler PostSecretsHandler) *PostSecrets { - return &PostSecrets{Context: ctx, Handler: handler} -} - -/* - PostSecrets swagger:route POST /secrets secret postSecrets - -Create new secret -*/ -type PostSecrets struct { - Context *middleware.Context - Handler PostSecretsHandler -} - -func (o *PostSecrets) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostSecretsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/secret/post_secrets_parameters.go b/console/service/restapi/operations/secret/post_secrets_parameters.go deleted file mode 100644 index 5280ee863..000000000 --- a/console/service/restapi/operations/secret/post_secrets_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPostSecretsParams creates a new PostSecretsParams object -// -// There are no default values defined in the spec. -func NewPostSecretsParams() PostSecretsParams { - - return PostSecretsParams{} -} - -// PostSecretsParams contains all the bound params for the post secrets operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostSecrets -type PostSecretsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestSecretCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostSecretsParams() beforehand. -func (o *PostSecretsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestSecretCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/secret/post_secrets_responses.go b/console/service/restapi/operations/secret/post_secrets_responses.go deleted file mode 100644 index 075afc486..000000000 --- a/console/service/restapi/operations/secret/post_secrets_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostSecretsOKCode is the HTTP code returned for type PostSecretsOK -const PostSecretsOKCode int = 200 - -/* -PostSecretsOK OK - -swagger:response postSecretsOK -*/ -type PostSecretsOK struct { - - /* - In: Body - */ - Payload *models.ResponseSecretInfo `json:"body,omitempty"` -} - -// NewPostSecretsOK creates PostSecretsOK with default headers values -func NewPostSecretsOK() *PostSecretsOK { - - return &PostSecretsOK{} -} - -// WithPayload adds the payload to the post secrets o k response -func (o *PostSecretsOK) WithPayload(payload *models.ResponseSecretInfo) *PostSecretsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post secrets o k response -func (o *PostSecretsOK) SetPayload(payload *models.ResponseSecretInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostSecretsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostSecretsBadRequestCode is the HTTP code returned for type PostSecretsBadRequest -const PostSecretsBadRequestCode int = 400 - -/* -PostSecretsBadRequest Error - -swagger:response postSecretsBadRequest -*/ -type PostSecretsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostSecretsBadRequest creates PostSecretsBadRequest with default headers values -func NewPostSecretsBadRequest() *PostSecretsBadRequest { - - return &PostSecretsBadRequest{} -} - -// WithPayload adds the payload to the post secrets bad request response -func (o *PostSecretsBadRequest) WithPayload(payload *models.ResponseError) *PostSecretsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post secrets bad request response -func (o *PostSecretsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostSecretsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/secret/post_secrets_urlbuilder.go b/console/service/restapi/operations/secret/post_secrets_urlbuilder.go deleted file mode 100644 index af303024f..000000000 --- a/console/service/restapi/operations/secret/post_secrets_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package secret - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostSecretsURL generates an URL for the post secrets operation -type PostSecretsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostSecretsURL) WithBasePath(bp string) *PostSecretsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostSecretsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostSecretsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/secrets" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostSecretsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostSecretsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostSecretsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostSecretsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostSecretsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostSecretsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/setting/get_settings.go b/console/service/restapi/operations/setting/get_settings.go deleted file mode 100644 index 94aad170e..000000000 --- a/console/service/restapi/operations/setting/get_settings.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetSettingsHandlerFunc turns a function with the right signature into a get settings handler -type GetSettingsHandlerFunc func(GetSettingsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetSettingsHandlerFunc) Handle(params GetSettingsParams) middleware.Responder { - return fn(params) -} - -// GetSettingsHandler interface for that can handle valid get settings params -type GetSettingsHandler interface { - Handle(GetSettingsParams) middleware.Responder -} - -// NewGetSettings creates a new http.Handler for the get settings operation -func NewGetSettings(ctx *middleware.Context, handler GetSettingsHandler) *GetSettings { - return &GetSettings{Context: ctx, Handler: handler} -} - -/* - GetSettings swagger:route GET /settings setting getSettings - -Get settings -*/ -type GetSettings struct { - Context *middleware.Context - Handler GetSettingsHandler -} - -func (o *GetSettings) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetSettingsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/setting/get_settings_parameters.go b/console/service/restapi/operations/setting/get_settings_parameters.go deleted file mode 100644 index b4b6e5860..000000000 --- a/console/service/restapi/operations/setting/get_settings_parameters.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetSettingsParams creates a new GetSettingsParams object -// -// There are no default values defined in the spec. -func NewGetSettingsParams() GetSettingsParams { - - return GetSettingsParams{} -} - -// GetSettingsParams contains all the bound params for the get settings operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetSettings -type GetSettingsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Limit *int64 - /*Filter by name - In: query - */ - Name *string - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetSettingsParams() beforehand. -func (o *GetSettingsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qName, qhkName, _ := qs.GetOK("name") - if err := o.bindName(qName, qhkName, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *GetSettingsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindName binds and validates parameter Name from query. -func (o *GetSettingsParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Name = &raw - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *GetSettingsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/console/service/restapi/operations/setting/get_settings_responses.go b/console/service/restapi/operations/setting/get_settings_responses.go deleted file mode 100644 index 17bd7095a..000000000 --- a/console/service/restapi/operations/setting/get_settings_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetSettingsOKCode is the HTTP code returned for type GetSettingsOK -const GetSettingsOKCode int = 200 - -/* -GetSettingsOK OK - -swagger:response getSettingsOK -*/ -type GetSettingsOK struct { - - /* - In: Body - */ - Payload *models.ResponseSettings `json:"body,omitempty"` -} - -// NewGetSettingsOK creates GetSettingsOK with default headers values -func NewGetSettingsOK() *GetSettingsOK { - - return &GetSettingsOK{} -} - -// WithPayload adds the payload to the get settings o k response -func (o *GetSettingsOK) WithPayload(payload *models.ResponseSettings) *GetSettingsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get settings o k response -func (o *GetSettingsOK) SetPayload(payload *models.ResponseSettings) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetSettingsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetSettingsBadRequestCode is the HTTP code returned for type GetSettingsBadRequest -const GetSettingsBadRequestCode int = 400 - -/* -GetSettingsBadRequest Error - -swagger:response getSettingsBadRequest -*/ -type GetSettingsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewGetSettingsBadRequest creates GetSettingsBadRequest with default headers values -func NewGetSettingsBadRequest() *GetSettingsBadRequest { - - return &GetSettingsBadRequest{} -} - -// WithPayload adds the payload to the get settings bad request response -func (o *GetSettingsBadRequest) WithPayload(payload *models.ResponseError) *GetSettingsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get settings bad request response -func (o *GetSettingsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetSettingsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/setting/get_settings_urlbuilder.go b/console/service/restapi/operations/setting/get_settings_urlbuilder.go deleted file mode 100644 index 7c9c5f8da..000000000 --- a/console/service/restapi/operations/setting/get_settings_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetSettingsURL generates an URL for the get settings operation -type GetSettingsURL struct { - Limit *int64 - Name *string - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetSettingsURL) WithBasePath(bp string) *GetSettingsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetSettingsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetSettingsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/settings" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var nameQ string - if o.Name != nil { - nameQ = *o.Name - } - if nameQ != "" { - qs.Set("name", nameQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetSettingsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetSettingsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetSettingsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetSettingsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetSettingsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetSettingsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/setting/patch_settings_name.go b/console/service/restapi/operations/setting/patch_settings_name.go deleted file mode 100644 index 4a8bd83b0..000000000 --- a/console/service/restapi/operations/setting/patch_settings_name.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchSettingsNameHandlerFunc turns a function with the right signature into a patch settings name handler -type PatchSettingsNameHandlerFunc func(PatchSettingsNameParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchSettingsNameHandlerFunc) Handle(params PatchSettingsNameParams) middleware.Responder { - return fn(params) -} - -// PatchSettingsNameHandler interface for that can handle valid patch settings name params -type PatchSettingsNameHandler interface { - Handle(PatchSettingsNameParams) middleware.Responder -} - -// NewPatchSettingsName creates a new http.Handler for the patch settings name operation -func NewPatchSettingsName(ctx *middleware.Context, handler PatchSettingsNameHandler) *PatchSettingsName { - return &PatchSettingsName{Context: ctx, Handler: handler} -} - -/* - PatchSettingsName swagger:route PATCH /settings/{name} setting patchSettingsName - -Changed setting -*/ -type PatchSettingsName struct { - Context *middleware.Context - Handler PatchSettingsNameHandler -} - -func (o *PatchSettingsName) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchSettingsNameParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/setting/patch_settings_name_parameters.go b/console/service/restapi/operations/setting/patch_settings_name_parameters.go deleted file mode 100644 index 1d11909d1..000000000 --- a/console/service/restapi/operations/setting/patch_settings_name_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPatchSettingsNameParams creates a new PatchSettingsNameParams object -// -// There are no default values defined in the spec. -func NewPatchSettingsNameParams() PatchSettingsNameParams { - - return PatchSettingsNameParams{} -} - -// PatchSettingsNameParams contains all the bound params for the patch settings name operation -// typically these are obtained from a http.Request -// -// swagger:parameters PatchSettingsName -type PatchSettingsNameParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestChangeSetting - /* - Required: true - In: path - */ - Name string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchSettingsNameParams() beforehand. -func (o *PatchSettingsNameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestChangeSetting - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rName, rhkName, _ := route.Params.GetOK("name") - if err := o.bindName(rName, rhkName, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindName binds and validates parameter Name from path. -func (o *PatchSettingsNameParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Name = raw - - return nil -} diff --git a/console/service/restapi/operations/setting/patch_settings_name_responses.go b/console/service/restapi/operations/setting/patch_settings_name_responses.go deleted file mode 100644 index adc848e27..000000000 --- a/console/service/restapi/operations/setting/patch_settings_name_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PatchSettingsNameOKCode is the HTTP code returned for type PatchSettingsNameOK -const PatchSettingsNameOKCode int = 200 - -/* -PatchSettingsNameOK OK - -swagger:response patchSettingsNameOK -*/ -type PatchSettingsNameOK struct { - - /* - In: Body - */ - Payload *models.ResponseSetting `json:"body,omitempty"` -} - -// NewPatchSettingsNameOK creates PatchSettingsNameOK with default headers values -func NewPatchSettingsNameOK() *PatchSettingsNameOK { - - return &PatchSettingsNameOK{} -} - -// WithPayload adds the payload to the patch settings name o k response -func (o *PatchSettingsNameOK) WithPayload(payload *models.ResponseSetting) *PatchSettingsNameOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch settings name o k response -func (o *PatchSettingsNameOK) SetPayload(payload *models.ResponseSetting) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchSettingsNameOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchSettingsNameBadRequestCode is the HTTP code returned for type PatchSettingsNameBadRequest -const PatchSettingsNameBadRequestCode int = 400 - -/* -PatchSettingsNameBadRequest Error - -swagger:response patchSettingsNameBadRequest -*/ -type PatchSettingsNameBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPatchSettingsNameBadRequest creates PatchSettingsNameBadRequest with default headers values -func NewPatchSettingsNameBadRequest() *PatchSettingsNameBadRequest { - - return &PatchSettingsNameBadRequest{} -} - -// WithPayload adds the payload to the patch settings name bad request response -func (o *PatchSettingsNameBadRequest) WithPayload(payload *models.ResponseError) *PatchSettingsNameBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch settings name bad request response -func (o *PatchSettingsNameBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchSettingsNameBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/setting/patch_settings_name_urlbuilder.go b/console/service/restapi/operations/setting/patch_settings_name_urlbuilder.go deleted file mode 100644 index c41850cf6..000000000 --- a/console/service/restapi/operations/setting/patch_settings_name_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchSettingsNameURL generates an URL for the patch settings name operation -type PatchSettingsNameURL struct { - Name string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchSettingsNameURL) WithBasePath(bp string) *PatchSettingsNameURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchSettingsNameURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchSettingsNameURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/settings/{name}" - - name := o.Name - if name != "" { - _path = strings.Replace(_path, "{name}", name, -1) - } else { - return nil, errors.New("name is required on PatchSettingsNameURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchSettingsNameURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchSettingsNameURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchSettingsNameURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchSettingsNameURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchSettingsNameURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchSettingsNameURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/setting/post_settings.go b/console/service/restapi/operations/setting/post_settings.go deleted file mode 100644 index 2fa8623f5..000000000 --- a/console/service/restapi/operations/setting/post_settings.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PostSettingsHandlerFunc turns a function with the right signature into a post settings handler -type PostSettingsHandlerFunc func(PostSettingsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostSettingsHandlerFunc) Handle(params PostSettingsParams) middleware.Responder { - return fn(params) -} - -// PostSettingsHandler interface for that can handle valid post settings params -type PostSettingsHandler interface { - Handle(PostSettingsParams) middleware.Responder -} - -// NewPostSettings creates a new http.Handler for the post settings operation -func NewPostSettings(ctx *middleware.Context, handler PostSettingsHandler) *PostSettings { - return &PostSettings{Context: ctx, Handler: handler} -} - -/* - PostSettings swagger:route POST /settings setting postSettings - -Create new setting -*/ -type PostSettings struct { - Context *middleware.Context - Handler PostSettingsHandler -} - -func (o *PostSettings) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPostSettingsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/setting/post_settings_parameters.go b/console/service/restapi/operations/setting/post_settings_parameters.go deleted file mode 100644 index 77a64c700..000000000 --- a/console/service/restapi/operations/setting/post_settings_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "postgesql-cluster-console/models" -) - -// NewPostSettingsParams creates a new PostSettingsParams object -// -// There are no default values defined in the spec. -func NewPostSettingsParams() PostSettingsParams { - - return PostSettingsParams{} -} - -// PostSettingsParams contains all the bound params for the post settings operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostSettings -type PostSettingsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *models.RequestCreateSetting -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostSettingsParams() beforehand. -func (o *PostSettingsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.RequestCreateSetting - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/setting/post_settings_responses.go b/console/service/restapi/operations/setting/post_settings_responses.go deleted file mode 100644 index 0205ab5e9..000000000 --- a/console/service/restapi/operations/setting/post_settings_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// PostSettingsOKCode is the HTTP code returned for type PostSettingsOK -const PostSettingsOKCode int = 200 - -/* -PostSettingsOK OK - -swagger:response postSettingsOK -*/ -type PostSettingsOK struct { - - /* - In: Body - */ - Payload *models.ResponseSetting `json:"body,omitempty"` -} - -// NewPostSettingsOK creates PostSettingsOK with default headers values -func NewPostSettingsOK() *PostSettingsOK { - - return &PostSettingsOK{} -} - -// WithPayload adds the payload to the post settings o k response -func (o *PostSettingsOK) WithPayload(payload *models.ResponseSetting) *PostSettingsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post settings o k response -func (o *PostSettingsOK) SetPayload(payload *models.ResponseSetting) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostSettingsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostSettingsBadRequestCode is the HTTP code returned for type PostSettingsBadRequest -const PostSettingsBadRequestCode int = 400 - -/* -PostSettingsBadRequest Error - -swagger:response postSettingsBadRequest -*/ -type PostSettingsBadRequest struct { - - /* - In: Body - */ - Payload *models.ResponseError `json:"body,omitempty"` -} - -// NewPostSettingsBadRequest creates PostSettingsBadRequest with default headers values -func NewPostSettingsBadRequest() *PostSettingsBadRequest { - - return &PostSettingsBadRequest{} -} - -// WithPayload adds the payload to the post settings bad request response -func (o *PostSettingsBadRequest) WithPayload(payload *models.ResponseError) *PostSettingsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post settings bad request response -func (o *PostSettingsBadRequest) SetPayload(payload *models.ResponseError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostSettingsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/setting/post_settings_urlbuilder.go b/console/service/restapi/operations/setting/post_settings_urlbuilder.go deleted file mode 100644 index 8dd905ee3..000000000 --- a/console/service/restapi/operations/setting/post_settings_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package setting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostSettingsURL generates an URL for the post settings operation -type PostSettingsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostSettingsURL) WithBasePath(bp string) *PostSettingsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostSettingsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostSettingsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/settings" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostSettingsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostSettingsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostSettingsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostSettingsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostSettingsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostSettingsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/operations/system/get_version.go b/console/service/restapi/operations/system/get_version.go deleted file mode 100644 index aa59b4d70..000000000 --- a/console/service/restapi/operations/system/get_version.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package system - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetVersionHandlerFunc turns a function with the right signature into a get version handler -type GetVersionHandlerFunc func(GetVersionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetVersionHandlerFunc) Handle(params GetVersionParams) middleware.Responder { - return fn(params) -} - -// GetVersionHandler interface for that can handle valid get version params -type GetVersionHandler interface { - Handle(GetVersionParams) middleware.Responder -} - -// NewGetVersion creates a new http.Handler for the get version operation -func NewGetVersion(ctx *middleware.Context, handler GetVersionHandler) *GetVersion { - return &GetVersion{Context: ctx, Handler: handler} -} - -/* - GetVersion swagger:route GET /version system getVersion - -Get version of server -*/ -type GetVersion struct { - Context *middleware.Context - Handler GetVersionHandler -} - -func (o *GetVersion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetVersionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/console/service/restapi/operations/system/get_version_parameters.go b/console/service/restapi/operations/system/get_version_parameters.go deleted file mode 100644 index 9f2ef3147..000000000 --- a/console/service/restapi/operations/system/get_version_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package system - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetVersionParams creates a new GetVersionParams object -// -// There are no default values defined in the spec. -func NewGetVersionParams() GetVersionParams { - - return GetVersionParams{} -} - -// GetVersionParams contains all the bound params for the get version operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetVersion -type GetVersionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetVersionParams() beforehand. -func (o *GetVersionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/console/service/restapi/operations/system/get_version_responses.go b/console/service/restapi/operations/system/get_version_responses.go deleted file mode 100644 index 0f0f5f91e..000000000 --- a/console/service/restapi/operations/system/get_version_responses.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package system - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "postgesql-cluster-console/models" -) - -// GetVersionOKCode is the HTTP code returned for type GetVersionOK -const GetVersionOKCode int = 200 - -/* -GetVersionOK OK - -swagger:response getVersionOK -*/ -type GetVersionOK struct { - - /* - In: Body - */ - Payload *models.ResponseVersion `json:"body,omitempty"` -} - -// NewGetVersionOK creates GetVersionOK with default headers values -func NewGetVersionOK() *GetVersionOK { - - return &GetVersionOK{} -} - -// WithPayload adds the payload to the get version o k response -func (o *GetVersionOK) WithPayload(payload *models.ResponseVersion) *GetVersionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get version o k response -func (o *GetVersionOK) SetPayload(payload *models.ResponseVersion) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetVersionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/console/service/restapi/operations/system/get_version_urlbuilder.go b/console/service/restapi/operations/system/get_version_urlbuilder.go deleted file mode 100644 index 3b5a18a31..000000000 --- a/console/service/restapi/operations/system/get_version_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package system - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetVersionURL generates an URL for the get version operation -type GetVersionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetVersionURL) WithBasePath(bp string) *GetVersionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetVersionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetVersionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/version" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/api/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetVersionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetVersionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetVersionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetVersionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetVersionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetVersionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/console/service/restapi/server.go b/console/service/restapi/server.go deleted file mode 100644 index f751f2289..000000000 --- a/console/service/restapi/server.go +++ /dev/null @@ -1,508 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package restapi - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "io/ioutil" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "postgesql-cluster-console/restapi/operations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api pg console server but does not configure it -func NewServer(api *operations.PgConsoleAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the pg console API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/pg-console.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *operations.PgConsoleAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *operations.PgConsoleAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving pg console at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving pg console at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving pg console at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving pg console at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := ioutil.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving pg console at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving pg console at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -}