diff --git a/services/loadbalancer/api_default.go b/services/loadbalancer/api_default.go index bf51e42c5..7359d5c67 100644 --- a/services/loadbalancer/api_default.go +++ b/services/loadbalancer/api_default.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -26,6 +26,139 @@ import ( // DefaultApiService DefaultApi service type DefaultApiService service +type ApiCreateCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string + createCredentialsPayload *CreateCredentialsPayload +} + +func (r ApiCreateCredentialsRequest) XRequestID(xRequestID string) ApiCreateCredentialsRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CreateCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateCredentialsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + if r.createCredentialsPayload == nil { + return localVarReturnValue, fmt.Errorf("createCredentialsPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + // body params + localVarPostBody = r.createCredentialsPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateCredentials Create credentials for observability of the Load Balancer + +Create credentials will create credentials, which can be used for load balancer observability + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateCredentialsRequest +*/ +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string) (*CreateCredentialsResponse, error) { + r := ApiCreateCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + type ApiCreateLoadBalancerRequest struct { ctx context.Context apiService *DefaultApiService @@ -34,30 +167,503 @@ type ApiCreateLoadBalancerRequest struct { createLoadBalancerPayload *CreateLoadBalancerPayload } -func (r ApiCreateLoadBalancerRequest) XRequestID(xRequestID string) ApiCreateLoadBalancerRequest { - r.xRequestID = &xRequestID - return r +func (r ApiCreateLoadBalancerRequest) XRequestID(xRequestID string) ApiCreateLoadBalancerRequest { + r.xRequestID = &xRequestID + return r +} + +func (r ApiCreateLoadBalancerRequest) CreateLoadBalancerPayload(createLoadBalancerPayload CreateLoadBalancerPayload) ApiCreateLoadBalancerRequest { + r.createLoadBalancerPayload = &createLoadBalancerPayload + return r +} + +func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoadBalancer + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/load-balancers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.xRequestID == nil { + return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") + } + if r.createLoadBalancerPayload == nil { + return localVarReturnValue, fmt.Errorf("createLoadBalancerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") + // body params + localVarPostBody = r.createLoadBalancerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateLoadBalancer Create a load balancer in a project. + +Create Load Balancer will create a load balancer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiCreateLoadBalancerRequest +*/ +func (a *APIClient) CreateLoadBalancer(ctx context.Context, projectId string) ApiCreateLoadBalancerRequest { + return ApiCreateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) CreateLoadBalancerExecute(ctx context.Context, projectId string) (*LoadBalancer, error) { + r := ApiCreateLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string +} + +func (r ApiDeleteCredentialsRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/credentials/{credentialsRef}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteCredentials Delete a single credential in a project. + +Delete Credential + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param credentialsRef + @return ApiDeleteCredentialsRequest +*/ +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, credentialsRef string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } +} + +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (map[string]interface{}, error) { + r := ApiDeleteCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, + } + return r.Execute() +} + +type ApiDeleteLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string +} + +func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLoadBalancer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/load-balancers/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DeleteLoadBalancer Delete a given load balancer in a project. + +DeleteLoadBalancer will delete a given load balancer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param name + @return ApiDeleteLoadBalancerRequest +*/ +func (a *APIClient) DeleteLoadBalancer(ctx context.Context, projectId string, name string) ApiDeleteLoadBalancerRequest { + return ApiDeleteLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } +} + +func (a *APIClient) DeleteLoadBalancerExecute(ctx context.Context, projectId string, name string) (map[string]interface{}, error) { + r := ApiDeleteLoadBalancerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + name: name, + } + return r.Execute() +} + +type ApiDisableLoadBalancingRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiDisableLoadBalancingRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableLoadBalancing") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +DisableLoadBalancing Disables the functionality of load balancers for the project specified. + +Disable will disable the load balancer functionality for the project specified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiDisableLoadBalancingRequest +*/ +func (a *APIClient) DisableLoadBalancing(ctx context.Context, projectId string) ApiDisableLoadBalancingRequest { + return ApiDisableLoadBalancingRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } } -func (r ApiCreateLoadBalancerRequest) CreateLoadBalancerPayload(createLoadBalancerPayload CreateLoadBalancerPayload) ApiCreateLoadBalancerRequest { - r.createLoadBalancerPayload = &createLoadBalancerPayload +func (a *APIClient) DisableLoadBalancingExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { + r := ApiDisableLoadBalancingRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiEnableLoadBalancingRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + xRequestID *string +} + +func (r ApiEnableLoadBalancingRequest) XRequestID(xRequestID string) ApiEnableLoadBalancingRequest { + r.xRequestID = &xRequestID return r } -func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { +func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *LoadBalancer + localVarReturnValue map[string]interface{} ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLoadBalancer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableLoadBalancing") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" + localVarPath := localBasePath + "/v1/projects/{projectId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -66,12 +672,9 @@ func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { if r.xRequestID == nil { return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") } - if r.createLoadBalancerPayload == nil { - return localVarReturnValue, fmt.Errorf("createLoadBalancerPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -88,8 +691,6 @@ func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") - // body params - localVarPostBody = r.createLoadBalancerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -134,24 +735,24 @@ func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { } /* -CreateLoadBalancer Create a load balancer in a project. +EnableLoadBalancing Enables the functionality of load balancers for the project specified. -Create Load Balancer will create a load balancer. +Enable will enable the load balancer functionality for the project specified. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @return ApiCreateLoadBalancerRequest + @return ApiEnableLoadBalancingRequest */ -func (a *APIClient) CreateLoadBalancer(ctx context.Context, projectId string) ApiCreateLoadBalancerRequest { - return ApiCreateLoadBalancerRequest{ +func (a *APIClient) EnableLoadBalancing(ctx context.Context, projectId string) ApiEnableLoadBalancingRequest { + return ApiEnableLoadBalancingRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) CreateLoadBalancerExecute(ctx context.Context, projectId string) (*LoadBalancer, error) { - r := ApiCreateLoadBalancerRequest{ +func (a *APIClient) EnableLoadBalancingExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { + r := ApiEnableLoadBalancingRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -159,29 +760,29 @@ func (a *APIClient) CreateLoadBalancerExecute(ctx context.Context, projectId str return r.Execute() } -type ApiDeleteLoadBalancerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - name string +type ApiGetCredentialsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + credentialsRef string } -func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) { +func (r ApiGetCredentialsRequest) Execute() (*GetCredentialsResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *GetCredentialsResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLoadBalancer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath := localBasePath + "/v1/projects/{projectId}/credentials/{credentialsRef}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(r.credentialsRef, "credentialsRef")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -248,55 +849,57 @@ func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) } /* -DeleteLoadBalancer Delete a given load balancer in a project. +GetCredentials Get a single credential reference in a project. -DeleteLoadBalancer will delete a given load balancer. +Get Credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @param name - @return ApiDeleteLoadBalancerRequest + @param credentialsRef + @return ApiGetCredentialsRequest */ -func (a *APIClient) DeleteLoadBalancer(ctx context.Context, projectId string, name string) ApiDeleteLoadBalancerRequest { - return ApiDeleteLoadBalancerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - name: name, +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, credentialsRef string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, } } -func (a *APIClient) DeleteLoadBalancerExecute(ctx context.Context, projectId string, name string) (map[string]interface{}, error) { - r := ApiDeleteLoadBalancerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - name: name, +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, credentialsRef string) (*GetCredentialsResponse, error) { + r := ApiGetCredentialsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + credentialsRef: credentialsRef, } return r.Execute() } -type ApiDisableLoadBalancingRequest struct { +type ApiGetLoadBalancerRequest struct { ctx context.Context apiService *DefaultApiService projectId string + name string } -func (r ApiDisableLoadBalancingRequest) Execute() (map[string]interface{}, error) { +func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *LoadBalancer ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableLoadBalancing") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoadBalancer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath := localBasePath + "/v1/projects/{projectId}/load-balancers/{name}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -363,65 +966,59 @@ func (r ApiDisableLoadBalancingRequest) Execute() (map[string]interface{}, error } /* -DisableLoadBalancing Disables the functionality of load balancers for the project specified. +GetLoadBalancer Get a single load balancer in a project. -Disable will disable the load balancer functionality for the project specified. +Get Load Balancer will get a single load balancer of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @return ApiDisableLoadBalancingRequest + @param name + @return ApiGetLoadBalancerRequest */ -func (a *APIClient) DisableLoadBalancing(ctx context.Context, projectId string) ApiDisableLoadBalancingRequest { - return ApiDisableLoadBalancingRequest{ +func (a *APIClient) GetLoadBalancer(ctx context.Context, projectId string, name string) ApiGetLoadBalancerRequest { + return ApiGetLoadBalancerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + name: name, } } -func (a *APIClient) DisableLoadBalancingExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { - r := ApiDisableLoadBalancingRequest{ +func (a *APIClient) GetLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { + r := ApiGetLoadBalancerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + name: name, } return r.Execute() } -type ApiEnableLoadBalancingRequest struct { +type ApiGetStatusRequest struct { ctx context.Context apiService *DefaultApiService projectId string - xRequestID *string -} - -func (r ApiEnableLoadBalancingRequest) XRequestID(xRequestID string) ApiEnableLoadBalancingRequest { - r.xRequestID = &xRequestID - return r } -func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) { +func (r ApiGetStatusRequest) Execute() (*StatusResponse, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *StatusResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableLoadBalancing") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatus") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath := localBasePath + "/v1/projects/{projectId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.xRequestID == nil { - return localVarReturnValue, fmt.Errorf("xRequestID is required and must be specified") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -440,7 +1037,6 @@ func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Request-ID", r.xRequestID, "") req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -485,24 +1081,24 @@ func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) } /* -EnableLoadBalancing Enables the functionality of load balancers for the project specified. +GetStatus Return the status of load balancer functionality for the project specified. -Enable will enable the load balancer functionality for the project specified. +Status will return the load balancer functionality status for the project specified. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @return ApiEnableLoadBalancingRequest + @return ApiGetStatusRequest */ -func (a *APIClient) EnableLoadBalancing(ctx context.Context, projectId string) ApiEnableLoadBalancingRequest { - return ApiEnableLoadBalancingRequest{ +func (a *APIClient) GetStatus(ctx context.Context, projectId string) ApiGetStatusRequest { + return ApiGetStatusRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) EnableLoadBalancingExecute(ctx context.Context, projectId string) (map[string]interface{}, error) { - r := ApiEnableLoadBalancingRequest{ +func (a *APIClient) GetStatusExecute(ctx context.Context, projectId string) (*StatusResponse, error) { + r := ApiGetStatusRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -510,29 +1106,27 @@ func (a *APIClient) EnableLoadBalancingExecute(ctx context.Context, projectId st return r.Execute() } -type ApiGetLoadBalancerRequest struct { +type ApiListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string - name string } -func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *LoadBalancer + localVarReturnValue *ListCredentialsResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoadBalancer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCredentials") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" + localVarPath := localBasePath + "/v1/projects/{projectId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -599,54 +1193,51 @@ func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { } /* -GetLoadBalancer Get a single load balancer in a project. +ListCredentials List all credentials in a project. -Get Load Balancer will get a single load balancer of a project. +List Credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @param name - @return ApiGetLoadBalancerRequest + @return ApiListCredentialsRequest */ -func (a *APIClient) GetLoadBalancer(ctx context.Context, projectId string, name string) ApiGetLoadBalancerRequest { - return ApiGetLoadBalancerRequest{ +func (a *APIClient) ListCredentials(ctx context.Context, projectId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - name: name, } } -func (a *APIClient) GetLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { - r := ApiGetLoadBalancerRequest{ +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string) (*ListCredentialsResponse, error) { + r := ApiListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - name: name, } return r.Execute() } -type ApiGetStatusRequest struct { +type ApiListLoadBalancersRequest struct { ctx context.Context apiService *DefaultApiService projectId string } -func (r ApiGetStatusRequest) Execute() (*StatusResponse, error) { +func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *StatusResponse + localVarReturnValue *ListLoadBalancersResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatus") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLoadBalancers") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}" + localVarPath := localBasePath + "/v1/projects/{projectId}/load-balancers" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -714,24 +1305,24 @@ func (r ApiGetStatusRequest) Execute() (*StatusResponse, error) { } /* -GetStatus Return the status of load balancer functionality for the project specified. +ListLoadBalancers List load balancers in a project. -Status will return the load balancer functionality status for the project specified. +ListLoadBalancer will list load balancers of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @return ApiGetStatusRequest + @return ApiListLoadBalancersRequest */ -func (a *APIClient) GetStatus(ctx context.Context, projectId string) ApiGetStatusRequest { - return ApiGetStatusRequest{ +func (a *APIClient) ListLoadBalancers(ctx context.Context, projectId string) ApiListLoadBalancersRequest { + return ApiListLoadBalancersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) GetStatusExecute(ctx context.Context, projectId string) (*StatusResponse, error) { - r := ApiGetStatusRequest{ +func (a *APIClient) ListLoadBalancersExecute(ctx context.Context, projectId string) (*ListLoadBalancersResponse, error) { + r := ApiListLoadBalancersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -739,34 +1330,45 @@ func (a *APIClient) GetStatusExecute(ctx context.Context, projectId string) (*St return r.Execute() } -type ApiListLoadBalancersRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ApiUpdateLoadBalancerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + name string + updateLoadBalancerPayload *UpdateLoadBalancerPayload } -func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, error) { +func (r ApiUpdateLoadBalancerRequest) UpdateLoadBalancerPayload(updateLoadBalancerPayload UpdateLoadBalancerPayload) ApiUpdateLoadBalancerRequest { + r.updateLoadBalancerPayload = &updateLoadBalancerPayload + return r +} + +func (r ApiUpdateLoadBalancerRequest) Execute() (*LoadBalancer, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListLoadBalancersResponse + localVarReturnValue *LoadBalancer ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLoadBalancers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateLoadBalancer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" + localVarPath := localBasePath + "/v1/projects/{projectId}/load-balancers/{name}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.updateLoadBalancerPayload == nil { + return localVarReturnValue, fmt.Errorf("updateLoadBalancerPayload is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -782,6 +1384,8 @@ func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, erro if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateLoadBalancerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -826,27 +1430,32 @@ func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, erro } /* -ListLoadBalancers List load balancers in a project. +UpdateLoadBalancer Update a load balancer in a project. -ListLoadBalancer will list load balancers of a project. +Update Load Balancer allows the change of listeners and target pools of an existing Load Balancer. + + The Load balancer resource version needs to be the current version to ensure concurrency safe updates. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @return ApiListLoadBalancersRequest + @param name + @return ApiUpdateLoadBalancerRequest */ -func (a *APIClient) ListLoadBalancers(ctx context.Context, projectId string) ApiListLoadBalancersRequest { - return ApiListLoadBalancersRequest{ +func (a *APIClient) UpdateLoadBalancer(ctx context.Context, projectId string, name string) ApiUpdateLoadBalancerRequest { + return ApiUpdateLoadBalancerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + name: name, } } -func (a *APIClient) ListLoadBalancersExecute(ctx context.Context, projectId string) (*ListLoadBalancersResponse, error) { - r := ApiListLoadBalancersRequest{ +func (a *APIClient) UpdateLoadBalancerExecute(ctx context.Context, projectId string, name string) (*LoadBalancer, error) { + r := ApiUpdateLoadBalancerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + name: name, } return r.Execute() } @@ -878,7 +1487,7 @@ func (r ApiUpdateTargetPoolRequest) Execute() (*TargetPool, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" + localVarPath := localBasePath + "/v1/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(r.name, "name")), -1) localVarPath = strings.Replace(localVarPath, "{"+"targetPoolName"+"}", url.PathEscape(ParameterValueToString(r.targetPoolName, "targetPoolName")), -1) @@ -958,6 +1567,8 @@ UpdateTargetPool Update a single target pool of a load balancer in a project. ReplaceTargetPool will replace a specific target pool of a load balancer with new content. Useful to add/remove target servers. will update a load balancer. + Only replaces the mentioned target pools and leaves others unchanged. + Cannot be used to create or rename a target pool. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId diff --git a/services/loadbalancer/api_default_test.go b/services/loadbalancer/api_default_test.go index fedda4a5b..ddfe87eef 100644 --- a/services/loadbalancer/api_default_test.go +++ b/services/loadbalancer/api_default_test.go @@ -23,8 +23,62 @@ import ( func Test_loadbalancer_DefaultApiService(t *testing.T) { + t.Run("Test DefaultApiService CreateCredentials", func(t *testing.T) { + path := "/v1/projects/{projectId}/credentials" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := CreateCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for loadbalancer_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + var xRequestID string + createCredentialsPayload := CreateCredentialsPayload{} + + resp, reqErr := apiClient.CreateCredentials(context.Background(), projectId).XRequestID(xRequestID).CreateCredentialsPayload(createCredentialsPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", err) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService CreateLoadBalancer", func(t *testing.T) { - path := "/v1beta/projects/{projectId}/load-balancers" + path := "/v1/projects/{projectId}/load-balancers" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) @@ -77,8 +131,63 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService DeleteCredentials", func(t *testing.T) { + path := "/v1/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := map[string]interface{}{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for loadbalancer_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + + resp, reqErr := apiClient.DeleteCredentials(context.Background(), projectId, credentialsRef).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", err) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService DeleteLoadBalancer", func(t *testing.T) { - path := "/v1beta/projects/{projectId}/load-balancers/{name}" + path := "/v1/projects/{projectId}/load-balancers/{name}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) nameValue := "name" @@ -133,7 +242,7 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DisableLoadBalancing", func(t *testing.T) { - path := "/v1beta/projects/{projectId}" + path := "/v1/projects/{projectId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) @@ -185,7 +294,7 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService EnableLoadBalancing", func(t *testing.T) { - path := "/v1beta/projects/{projectId}" + path := "/v1/projects/{projectId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) @@ -237,8 +346,63 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService GetCredentials", func(t *testing.T) { + path := "/v1/projects/{projectId}/credentials/{credentialsRef}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + credentialsRefValue := "credentialsRef" + path = strings.Replace(path, "{"+"credentialsRef"+"}", url.PathEscape(ParameterValueToString(credentialsRefValue, "credentialsRef")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for loadbalancer_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + credentialsRef := "credentialsRef" + + resp, reqErr := apiClient.GetCredentials(context.Background(), projectId, credentialsRef).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", err) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService GetLoadBalancer", func(t *testing.T) { - path := "/v1beta/projects/{projectId}/load-balancers/{name}" + path := "/v1/projects/{projectId}/load-balancers/{name}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) nameValue := "name" @@ -293,7 +457,7 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetStatus", func(t *testing.T) { - path := "/v1beta/projects/{projectId}" + path := "/v1/projects/{projectId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) @@ -344,8 +508,60 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService ListCredentials", func(t *testing.T) { + path := "/v1/projects/{projectId}/credentials" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListCredentialsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for loadbalancer_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.ListCredentials(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", err) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService ListLoadBalancers", func(t *testing.T) { - path := "/v1beta/projects/{projectId}/load-balancers" + path := "/v1/projects/{projectId}/load-balancers" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) @@ -396,8 +612,64 @@ func Test_loadbalancer_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService UpdateLoadBalancer", func(t *testing.T) { + path := "/v1/projects/{projectId}/load-balancers/{name}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nameValue := "name" + path = strings.Replace(path, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := LoadBalancer{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for loadbalancer_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + name := "name" + updateLoadBalancerPayload := UpdateLoadBalancerPayload{} + + resp, reqErr := apiClient.UpdateLoadBalancer(context.Background(), projectId, name).UpdateLoadBalancerPayload(updateLoadBalancerPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", err) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService UpdateTargetPool", func(t *testing.T) { - path := "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" + path := "/v1/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) nameValue := "name" diff --git a/services/loadbalancer/client.go b/services/loadbalancer/client.go index 6bd7be651..dd124a07a 100644 --- a/services/loadbalancer/client.go +++ b/services/loadbalancer/client.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Load Balancer API API v1beta.0.0 +// APIClient manages communication with the Load Balancer API API v1.4.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/loadbalancer/configuration.go b/services/loadbalancer/configuration.go index 352251e93..c3b44db1a 100644 --- a/services/loadbalancer/configuration.go +++ b/services/loadbalancer/configuration.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_active_health_check.go b/services/loadbalancer/model_active_health_check.go index 91869f7b9..903efb897 100644 --- a/services/loadbalancer/model_active_health_check.go +++ b/services/loadbalancer/model_active_health_check.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_create_credentials_payload.go b/services/loadbalancer/model_create_credentials_payload.go new file mode 100644 index 000000000..28fbc4815 --- /dev/null +++ b/services/loadbalancer/model_create_credentials_payload.go @@ -0,0 +1,20 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type CreateCredentialsPayload struct { + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // The password used for the ARGUS instance + Password *string `json:"password,omitempty"` + // The username used for the ARGUS instance + Username *string `json:"username,omitempty"` +} diff --git a/services/loadbalancer/model_create_credentials_response.go b/services/loadbalancer/model_create_credentials_response.go new file mode 100644 index 000000000..f20fe8409 --- /dev/null +++ b/services/loadbalancer/model_create_credentials_response.go @@ -0,0 +1,15 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type CreateCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} diff --git a/services/loadbalancer/model_create_load_balancer_payload.go b/services/loadbalancer/model_create_load_balancer_payload.go index 3765c9c13..7563e1722 100644 --- a/services/loadbalancer/model_create_load_balancer_payload.go +++ b/services/loadbalancer/model_create_load_balancer_payload.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -12,18 +12,20 @@ package loadbalancer type CreateLoadBalancerPayload struct { Errors *[]LoadBalancerError `json:"errors,omitempty"` - // External load balancer IP address where this load balancer is exposed. + // External load balancer IP address where this load balancer is exposed. Not changeable after creation. ExternalAddress *string `json:"externalAddress,omitempty"` - // List of all listeners which will accept traffic. + // List of all listeners which will accept traffic. Limited to 20. Listeners *[]Listener `json:"listeners,omitempty"` - // Load balancer name + // Load balancer name. Not changeable after creation. Name *string `json:"name,omitempty"` - // List of networks that listeners and targets reside in. Currently limited to one. + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. Networks *[]Network `json:"networks,omitempty"` Options *LoadBalancerOptions `json:"options,omitempty"` // Transient private load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` Status *string `json:"status,omitempty"` - // List of all target pools which will be used in the load balancer. + // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` } diff --git a/services/loadbalancer/model_credentials.go b/services/loadbalancer/model_credentials.go new file mode 100644 index 000000000..2409e6b4e --- /dev/null +++ b/services/loadbalancer/model_credentials.go @@ -0,0 +1,20 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type Credentials struct { + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // The password used for the ARGUS instance + Password *string `json:"password,omitempty"` + // The username used for the ARGUS instance + Username *string `json:"username,omitempty"` +} diff --git a/services/loadbalancer/model_credentials_response.go b/services/loadbalancer/model_credentials_response.go new file mode 100644 index 000000000..bb0b3b1bf --- /dev/null +++ b/services/loadbalancer/model_credentials_response.go @@ -0,0 +1,20 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type CredentialsResponse struct { + // The credentials reference can be used for observability of the Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // Credential name + DisplayName *string `json:"displayName,omitempty"` + // The username used for the ARGUS instance + Username *string `json:"username,omitempty"` +} diff --git a/services/loadbalancer/model_get_credentials_response.go b/services/loadbalancer/model_get_credentials_response.go new file mode 100644 index 000000000..5dc6ecaea --- /dev/null +++ b/services/loadbalancer/model_get_credentials_response.go @@ -0,0 +1,15 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type GetCredentialsResponse struct { + Credential *CredentialsResponse `json:"credential,omitempty"` +} diff --git a/services/loadbalancer/model_get_quota_response.go b/services/loadbalancer/model_get_quota_response.go index 44da46abb..cac74c85d 100644 --- a/services/loadbalancer/model_get_quota_response.go +++ b/services/loadbalancer/model_get_quota_response.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_healthz_response.go b/services/loadbalancer/model_healthz_response.go new file mode 100644 index 000000000..829cee89e --- /dev/null +++ b/services/loadbalancer/model_healthz_response.go @@ -0,0 +1,16 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type HealthzResponse struct { + // Human readable explanation about the response. + Message *string `json:"message,omitempty"` +} diff --git a/services/loadbalancer/model_list_credentials_response.go b/services/loadbalancer/model_list_credentials_response.go new file mode 100644 index 000000000..c69e480db --- /dev/null +++ b/services/loadbalancer/model_list_credentials_response.go @@ -0,0 +1,15 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type ListCredentialsResponse struct { + Credentials *[]CredentialsResponse `json:"credentials,omitempty"` +} diff --git a/services/loadbalancer/model_list_load_balancers_response.go b/services/loadbalancer/model_list_load_balancers_response.go index 99b72789c..df34f63a6 100644 --- a/services/loadbalancer/model_list_load_balancers_response.go +++ b/services/loadbalancer/model_list_load_balancers_response.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_listener.go b/services/loadbalancer/model_listener.go index 5114d7e1c..1ed227ffc 100644 --- a/services/loadbalancer/model_listener.go +++ b/services/loadbalancer/model_listener.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -12,6 +12,8 @@ package loadbalancer type Listener struct { DisplayName *string `json:"displayName,omitempty"` + // Will be used to reference a listener and will replace display name in the future. Currently uses - as the name if no display name is given. + Name *string `json:"name,omitempty"` // Port number where we listen for traffic Port *int64 `json:"port,omitempty"` // Protocol is the highest network protocol we understand to load balance. Currently only PROTOCOL_TCP and PROTOCOL_TCP_PROXY are supported. diff --git a/services/loadbalancer/model_load_balancer.go b/services/loadbalancer/model_load_balancer.go index 7cd54fe37..1520d329d 100644 --- a/services/loadbalancer/model_load_balancer.go +++ b/services/loadbalancer/model_load_balancer.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -12,18 +12,20 @@ package loadbalancer type LoadBalancer struct { Errors *[]LoadBalancerError `json:"errors,omitempty"` - // External load balancer IP address where this load balancer is exposed. + // External load balancer IP address where this load balancer is exposed. Not changeable after creation. ExternalAddress *string `json:"externalAddress,omitempty"` - // List of all listeners which will accept traffic. + // List of all listeners which will accept traffic. Limited to 20. Listeners *[]Listener `json:"listeners,omitempty"` - // Load balancer name + // Load balancer name. Not changeable after creation. Name *string `json:"name,omitempty"` - // List of networks that listeners and targets reside in. Currently limited to one. + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. Networks *[]Network `json:"networks,omitempty"` Options *LoadBalancerOptions `json:"options,omitempty"` // Transient private load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` Status *string `json:"status,omitempty"` - // List of all target pools which will be used in the load balancer. + // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` } diff --git a/services/loadbalancer/model_load_balancer_error.go b/services/loadbalancer/model_load_balancer_error.go index 020667f5b..d564db2c9 100644 --- a/services/loadbalancer/model_load_balancer_error.go +++ b/services/loadbalancer/model_load_balancer_error.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_load_balancer_options.go b/services/loadbalancer/model_load_balancer_options.go index 45c664839..25fa3c67d 100644 --- a/services/loadbalancer/model_load_balancer_options.go +++ b/services/loadbalancer/model_load_balancer_options.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -11,7 +11,9 @@ API version: 1beta.0.0 package loadbalancer type LoadBalancerOptions struct { - AccessControl *LoadbalancerOptionAccessControl `json:"accessControl,omitempty"` - // Load Balancer is accessable only via a private network ip address + AccessControl *LoadbalancerOptionAccessControl `json:"accessControl,omitempty"` + EphemeralAddress *bool `json:"ephemeralAddress,omitempty"` + Observability *LoadbalancerOptionObservability `json:"observability,omitempty"` + // Load Balancer is accessible only via a private network ip address. Not changeable after creation. PrivateNetworkOnly *bool `json:"privateNetworkOnly,omitempty"` } diff --git a/services/loadbalancer/model_loadbalancer_option_access_control.go b/services/loadbalancer/model_loadbalancer_option_access_control.go index 517ace0a5..049fba964 100644 --- a/services/loadbalancer/model_loadbalancer_option_access_control.go +++ b/services/loadbalancer/model_loadbalancer_option_access_control.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -11,6 +11,6 @@ API version: 1beta.0.0 package loadbalancer type LoadbalancerOptionAccessControl struct { - // Load Balancer is accessable only from an IP address in this range + // Load Balancer is accessible only from an IP address in this range AllowedSourceRanges *[]string `json:"allowedSourceRanges,omitempty"` } diff --git a/services/loadbalancer/model_loadbalancer_option_logs.go b/services/loadbalancer/model_loadbalancer_option_logs.go new file mode 100644 index 000000000..d71ee9188 --- /dev/null +++ b/services/loadbalancer/model_loadbalancer_option_logs.go @@ -0,0 +1,18 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type LoadbalancerOptionLogs struct { + // Credentials reference for metrics. Enables monitoring via logs for the Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // The ARGUS/Loki Push URL you want the logs to be send to. + PushUrl *string `json:"pushUrl,omitempty"` +} diff --git a/services/loadbalancer/model_loadbalancer_option_metrics.go b/services/loadbalancer/model_loadbalancer_option_metrics.go new file mode 100644 index 000000000..60899b973 --- /dev/null +++ b/services/loadbalancer/model_loadbalancer_option_metrics.go @@ -0,0 +1,18 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type LoadbalancerOptionMetrics struct { + // Credentials reference for metrics. Enables monitoring via remote write for the Load Balancer. + CredentialsRef *string `json:"credentialsRef,omitempty"` + // The ARGUS/Prometheus remote write Push URL you want the metrics to be send to. + PushUrl *string `json:"pushUrl,omitempty"` +} diff --git a/services/loadbalancer/model_loadbalancer_option_observability.go b/services/loadbalancer/model_loadbalancer_option_observability.go new file mode 100644 index 000000000..424b39416 --- /dev/null +++ b/services/loadbalancer/model_loadbalancer_option_observability.go @@ -0,0 +1,16 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type LoadbalancerOptionObservability struct { + Logs *LoadbalancerOptionLogs `json:"logs,omitempty"` + Metrics *LoadbalancerOptionMetrics `json:"metrics,omitempty"` +} diff --git a/services/loadbalancer/model_network.go b/services/loadbalancer/model_network.go index 943e99362..473c4e480 100644 --- a/services/loadbalancer/model_network.go +++ b/services/loadbalancer/model_network.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_ping_response.go b/services/loadbalancer/model_ping_response.go index a07f484c1..1e3ef3df4 100644 --- a/services/loadbalancer/model_ping_response.go +++ b/services/loadbalancer/model_ping_response.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_status_response.go b/services/loadbalancer/model_status_response.go index e5d494101..608562488 100644 --- a/services/loadbalancer/model_status_response.go +++ b/services/loadbalancer/model_status_response.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_target.go b/services/loadbalancer/model_target.go index 8a7fd0606..6e50546aa 100644 --- a/services/loadbalancer/model_target.go +++ b/services/loadbalancer/model_target.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_target_pool.go b/services/loadbalancer/model_target_pool.go index 2b52f32dc..649254c98 100644 --- a/services/loadbalancer/model_target_pool.go +++ b/services/loadbalancer/model_target_pool.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,6 +15,7 @@ type TargetPool struct { // Target pool name Name *string `json:"name,omitempty"` // Identical port number where each target listens for traffic. - TargetPort *int64 `json:"targetPort,omitempty"` - Targets *[]Target `json:"targets,omitempty"` + TargetPort *int64 `json:"targetPort,omitempty"` + // List of all targets which will be used in the pool. Limited to 250. + Targets *[]Target `json:"targets,omitempty"` } diff --git a/services/loadbalancer/model_update_load_balancer_payload.go b/services/loadbalancer/model_update_load_balancer_payload.go new file mode 100644 index 000000000..70bb11663 --- /dev/null +++ b/services/loadbalancer/model_update_load_balancer_payload.go @@ -0,0 +1,31 @@ +/* +Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.4.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package loadbalancer + +type UpdateLoadBalancerPayload struct { + Errors *[]LoadBalancerError `json:"errors,omitempty"` + // External load balancer IP address where this load balancer is exposed. Not changeable after creation. + ExternalAddress *string `json:"externalAddress,omitempty"` + // List of all listeners which will accept traffic. Limited to 20. + Listeners *[]Listener `json:"listeners,omitempty"` + // Load balancer name. Not changeable after creation. + Name *string `json:"name,omitempty"` + // List of networks that listeners and targets reside in. Currently limited to one. Not changeable after creation. + Networks *[]Network `json:"networks,omitempty"` + Options *LoadBalancerOptions `json:"options,omitempty"` + // Transient private load balancer IP address that can change any time. + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *string `json:"status,omitempty"` + // List of all target pools which will be used in the load balancer. Limited to 20. + TargetPools *[]TargetPool `json:"targetPools,omitempty"` + // Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. + Version *string `json:"version,omitempty"` +} diff --git a/services/loadbalancer/model_update_quota_request.go b/services/loadbalancer/model_update_quota_request.go index d6d6f2f31..a0ceeeb5f 100644 --- a/services/loadbalancer/model_update_quota_request.go +++ b/services/loadbalancer/model_update_quota_request.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_update_quota_response.go b/services/loadbalancer/model_update_quota_response.go index f8966932a..3de875191 100644 --- a/services/loadbalancer/model_update_quota_response.go +++ b/services/loadbalancer/model_update_quota_response.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/loadbalancer/model_update_target_pool_payload.go b/services/loadbalancer/model_update_target_pool_payload.go index 00a9bf0e2..27c021519 100644 --- a/services/loadbalancer/model_update_target_pool_payload.go +++ b/services/loadbalancer/model_update_target_pool_payload.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,6 +15,7 @@ type UpdateTargetPoolPayload struct { // Target pool name Name *string `json:"name,omitempty"` // Identical port number where each target listens for traffic. - TargetPort *int64 `json:"targetPort,omitempty"` - Targets *[]Target `json:"targets,omitempty"` + TargetPort *int64 `json:"targetPort,omitempty"` + // List of all targets which will be used in the pool. Limited to 250. + Targets *[]Target `json:"targets,omitempty"` } diff --git a/services/loadbalancer/utils.go b/services/loadbalancer/utils.go index 4b80296e8..eadd7d482 100644 --- a/services/loadbalancer/utils.go +++ b/services/loadbalancer/utils.go @@ -1,9 +1,9 @@ /* Load Balancer API -This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. This beta load balancer service is provided free of charge. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. -API version: 1beta.0.0 +API version: 1.4.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.