From 93875fc41621f77842a6d6cd0cc0af72be1a12df Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 11 Oct 2024 10:24:26 +0000 Subject: [PATCH] Generate iaasalpha --- services/iaasalpha/api_default.go | 3855 +++++++++++------ services/iaasalpha/api_default_test.go | 472 +- services/iaasalpha/go.mod | 2 +- services/iaasalpha/go.sum | 4 +- .../model_create_key_pair_payload.go | 24 + .../model_create_server_group_payload.go | 25 + .../iaasalpha/model_create_server_payload.go | 4 +- .../iaasalpha/model_key_pair_list_response.go | 4 +- services/iaasalpha/model_keypair.go | 6 +- .../iaasalpha/model_open_stack_network.go | 27 - .../model_public_network_list_response.go | 18 + services/iaasalpha/model_server.go | 4 +- services/iaasalpha/model_server_group.go | 25 + .../model_server_group_list_response.go | 18 + .../model_update_key_pair_payload.go | 17 + .../iaasalpha/model_update_nic_payload.go | 16 +- ...=> model_update_security_group_payload.go} | 4 +- ...load.go => model_update_server_payload.go} | 4 +- services/iaasalpha/model_v1_public_network.go | 18 + 19 files changed, 3125 insertions(+), 1422 deletions(-) create mode 100644 services/iaasalpha/model_create_key_pair_payload.go create mode 100644 services/iaasalpha/model_create_server_group_payload.go delete mode 100644 services/iaasalpha/model_open_stack_network.go create mode 100644 services/iaasalpha/model_public_network_list_response.go create mode 100644 services/iaasalpha/model_server_group.go create mode 100644 services/iaasalpha/model_server_group_list_response.go create mode 100644 services/iaasalpha/model_update_key_pair_payload.go rename services/iaasalpha/{model_v1alpha1_update_security_group_payload.go => model_update_security_group_payload.go} (77%) rename services/iaasalpha/{model_v1alpha1_update_server_payload.go => model_update_server_payload.go} (75%) create mode 100644 services/iaasalpha/model_v1_public_network.go diff --git a/services/iaasalpha/api_default.go b/services/iaasalpha/api_default.go index 611d56160..dd3cd4cc4 100644 --- a/services/iaasalpha/api_default.go +++ b/services/iaasalpha/api_default.go @@ -852,6 +852,9 @@ func (r ApiAddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListR if strlen(r.serverId) > 36 { return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1235,6 +1238,196 @@ func (a *APIClient) AddVolumeToServerExecute(ctx context.Context, projectId stri return r.Execute() } +type ApiCreateKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + createKeyPairPayload *CreateKeyPairPayload +} + +// Request a public key import. + +func (r ApiCreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { + r.createKeyPairPayload = &createKeyPairPayload + return r +} + +func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createKeyPairPayload == nil { + return localVarReturnValue, fmt.Errorf("createKeyPairPayload 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 + } + // body params + localVarPostBody = r.createKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + 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 +} + +/* +CreateKeyPair: Import a public key. + +Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest +*/ +func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + } +} + +func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { + r := ApiCreateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + } + return r.Execute() +} + type ApiCreateNICRequest struct { ctx context.Context apiService *DefaultApiService @@ -2240,34 +2433,34 @@ func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string) ( return r.Execute() } -type ApiCreateVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createVolumePayload *CreateVolumePayload +type ApiCreateServerGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createServerGroupPayload *CreateServerGroupPayload } -// Request a volume creation. +// Request a server group creation. -func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { - r.createVolumePayload = &createVolumePayload +func (r ApiCreateServerGroupRequest) CreateServerGroupPayload(createServerGroupPayload CreateServerGroupPayload) ApiCreateServerGroupRequest { + r.createServerGroupPayload = &createServerGroupPayload return r } -func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { +func (r ApiCreateServerGroupRequest) Execute() (*ServerGroup, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *ServerGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServerGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -2279,8 +2472,8 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("createVolumePayload is required and must be specified") + if r.createServerGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("createServerGroupPayload is required and must be specified") } // to determine the Content-Type header @@ -2301,7 +2494,7 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createVolumePayload + localVarPostBody = r.createServerGroupPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2405,24 +2598,24 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { } /* -CreateVolume: Create new volume. +CreateServerGroup: Create a new server group in a project. -Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. +Create a new server server group in the given project ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateVolumeRequest + @return ApiCreateServerGroupRequest */ -func (a *APIClient) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { - return ApiCreateVolumeRequest{ +func (a *APIClient) CreateServerGroup(ctx context.Context, projectId string) ApiCreateServerGroupRequest { + return ApiCreateServerGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) { - r := ApiCreateVolumeRequest{ +func (a *APIClient) CreateServerGroupExecute(ctx context.Context, projectId string) (*ServerGroup, error) { + r := ApiCreateServerGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -2430,47 +2623,51 @@ func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) ( return r.Execute() } -type ApiDeallocateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiCreateVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createVolumePayload *CreateVolumePayload } -func (r ApiDeallocateServerRequest) Execute() error { +// Request a volume creation. + +func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { + r.createVolumePayload = &createVolumePayload + return r +} + +func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeallocateServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVolume") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if r.createVolumePayload == nil { + return localVarReturnValue, fmt.Errorf("createVolumePayload 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) @@ -2486,9 +2683,11 @@ func (r ApiDeallocateServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createVolumePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -2502,14 +2701,14 @@ func (r ApiDeallocateServerRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2523,125 +2722,119 @@ func (r ApiDeallocateServerRequest) Execute() error { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + 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 } /* -DeallocateServer: Deallocate an existing server. +CreateVolume: Create new volume. -Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. +Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiDeallocateServerRequest + @return ApiCreateVolumeRequest */ -func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { - return ApiDeallocateServerRequest{ +func (a *APIClient) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, } } -func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiDeallocateServerRequest{ +func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) { + r := ApiCreateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, } return r.Execute() } -type ApiDeleteNICRequest struct { +type ApiDeallocateServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string - nicId string + serverId string } -func (r ApiDeleteNICRequest) Execute() error { +func (r ApiDeallocateServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNIC") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeallocateServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2652,17 +2845,11 @@ func (r ApiDeleteNICRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") - } - if strlen(r.nicId) < 36 { - return fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -2758,6 +2945,17 @@ func (r ApiDeleteNICRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2775,74 +2973,60 @@ func (r ApiDeleteNICRequest) Execute() error { } /* -DeleteNIC: Delete a network interface. +DeallocateServer: Deallocate an existing server. -Delete a network interface that is part of the project. +Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiDeleteNICRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest */ -func (a *APIClient) DeleteNIC(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNICRequest { - return ApiDeleteNICRequest{ +func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, - nicId: nicId, + serverId: serverId, } } -func (a *APIClient) DeleteNICExecute(ctx context.Context, projectId string, networkId string, nicId string) error { - r := ApiDeleteNICRequest{ +func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiDeallocateServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, - nicId: nicId, + serverId: serverId, } return r.Execute() } -type ApiDeletePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string +type ApiDeleteKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string } -func (r ApiDeletePublicIPRequest) Execute() error { +func (r ApiDeleteKeyPairRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeyPair") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath := localBasePath + "/v1alpha1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.keypairName) > 127 { + return fmt.Errorf("keypairName must have less than 127 elements") } // to determine the Content-Type header @@ -2955,56 +3139,55 @@ func (r ApiDeletePublicIPRequest) Execute() error { } /* -DeletePublicIP: Delete a public ip. +DeleteKeyPair: Delete an SSH keypair. -Delete a public ip that is part of the project. +Delete an SSH keypair from a user. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param publicIpId The identifier (ID) of a Public IP. - @return ApiDeletePublicIPRequest + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest */ -func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { - return ApiDeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } } -func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { - r := ApiDeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { + r := ApiDeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } return r.Execute() } -type ApiDeleteSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiDeleteNICRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + nicId string } -func (r ApiDeleteSecurityGroupRequest) Execute() error { +func (r ApiDeleteNICRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNIC") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3015,11 +3198,17 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return fmt.Errorf("nicId must have less than 36 elements") } // to determine the Content-Type header @@ -3115,17 +3304,6 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3143,58 +3321,59 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { } /* -DeleteSecurityGroup: Delete security group. +DeleteNIC: Delete a network interface. -Delete a security group. +Delete a network interface that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiDeleteSecurityGroupRequest + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNICRequest */ -func (a *APIClient) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { - return ApiDeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) DeleteNIC(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNICRequest { + return ApiDeleteNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, } } -func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { - r := ApiDeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) DeleteNICExecute(ctx context.Context, projectId string, networkId string, nicId string) error { + r := ApiDeleteNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type ApiDeleteSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string -} - -func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { - var ( +type ApiDeletePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + publicIpId string +} + +func (r ApiDeletePublicIPRequest) Execute() error { + var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroupRule") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3205,17 +3384,11 @@ func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") - } - if strlen(r.securityGroupRuleId) < 36 { - return fmt.Errorf("securityGroupRuleId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.securityGroupRuleId) > 36 { - return fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return fmt.Errorf("publicIpId must have less than 36 elements") } // to determine the Content-Type header @@ -3328,59 +3501,56 @@ func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { } /* -DeleteSecurityGroupRule: Delete security group rule. +DeletePublicIP: Delete a public ip. -Delete a security group rule. +Delete a public ip that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. - @return ApiDeleteSecurityGroupRuleRequest + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest */ -func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { - return ApiDeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, } } -func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error { - r := ApiDeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { + r := ApiDeletePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, } return r.Execute() } -type ApiDeleteServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiDeleteSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string } -func (r ApiDeleteServerRequest) Execute() error { +func (r ApiDeleteSecurityGroupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3391,11 +3561,11 @@ func (r ApiDeleteServerRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") } // to determine the Content-Type header @@ -3491,6 +3661,17 @@ func (r ApiDeleteServerRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3508,56 +3689,58 @@ func (r ApiDeleteServerRequest) Execute() error { } /* -DeleteServer: Delete a server. +DeleteSecurityGroup: Delete security group. -Delete a server. Volumes won't be deleted. +Delete a security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiDeleteServerRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest */ -func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { - return ApiDeleteServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiDeleteServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { + r := ApiDeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiDeleteVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string +type ApiDeleteSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + securityGroupRuleId string } -func (r ApiDeleteVolumeRequest) Execute() error { +func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroupRule") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3568,11 +3751,17 @@ func (r ApiDeleteVolumeRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return fmt.Errorf("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return fmt.Errorf("securityGroupRuleId must have less than 36 elements") } // to determine the Content-Type header @@ -3668,17 +3857,6 @@ func (r ApiDeleteVolumeRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3696,59 +3874,1174 @@ func (r ApiDeleteVolumeRequest) Execute() error { } /* -DeleteVolume: Delete a volume. +DeleteSecurityGroupRule: Delete security group rule. -Delete a volume inside a project. The deletion will fail if the volume is still in use. +Delete a security group rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiDeleteVolumeRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest */ -func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { - return ApiDeleteVolumeRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumeId: volumeId, +func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } } -func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := ApiDeleteVolumeRequest{ +func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error { + r := ApiDeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } + return r.Execute() +} + +type ApiDeleteServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string +} + +func (r ApiDeleteServerRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") + } + + // 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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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 err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteServer: Delete a server. + +Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest +*/ +func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiDeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } + return r.Execute() +} + +type ApiDeleteServerGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverGroupId string +} + +func (r ApiDeleteServerGroupRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServerGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(r.serverGroupId, "serverGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverGroupId) < 36 { + return fmt.Errorf("serverGroupId must have at least 36 elements") + } + if strlen(r.serverGroupId) > 36 { + return fmt.Errorf("serverGroupId must have less than 36 elements") + } + + // 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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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 err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteServerGroup: Delete a server group in a project. + +Delete a server group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverGroupId The identifier (ID) of a STACKIT Server Group. + @return ApiDeleteServerGroupRequest +*/ +func (a *APIClient) DeleteServerGroup(ctx context.Context, projectId string, serverGroupId string) ApiDeleteServerGroupRequest { + return ApiDeleteServerGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverGroupId: serverGroupId, + } +} + +func (a *APIClient) DeleteServerGroupExecute(ctx context.Context, projectId string, serverGroupId string) error { + r := ApiDeleteServerGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverGroupId: serverGroupId, + } + return r.Execute() +} + +type ApiDeleteVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + volumeId string +} + +func (r ApiDeleteVolumeRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return fmt.Errorf("volumeId must have less than 36 elements") + } + + // 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 err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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 err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteVolume: Delete a volume. + +Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest +*/ +func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { + r := ApiDeleteVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } + return r.Execute() +} + +type ApiGetAttachedVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + volumeId string +} + +func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + } + + // 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 + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + 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 +} + +/* +GetAttachedVolume: Get Volume Attachment details. + +Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest +*/ +func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { + r := ApiGetAttachedVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } + return r.Execute() +} + +type ApiGetKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string +} + +func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") + } + + // 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 + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + 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 +} + +/* +GetKeyPair: Get SSH keypair details. + +Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest +*/ +func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } +} + +func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { + r := ApiGetKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } + return r.Execute() +} + +type ApiGetNICRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + nicId string +} + +func (r ApiGetNICRequest) Execute() (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNIC") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + } + + // 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 + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + 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, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + 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 +} + +/* +GetNIC: Get details about a network interface. + +Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNICRequest +*/ +func (a *APIClient) GetNIC(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNICRequest { + return ApiGetNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +func (a *APIClient) GetNICExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { + r := ApiGetNICRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type ApiGetAttachedVolumeRequest struct { +type ApiGetNetworkRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string - volumeId string + networkId string } -func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { +func (r ApiGetNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachment + localVarReturnValue *Network ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3759,17 +5052,11 @@ func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") - } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } // to determine the Content-Type header @@ -3892,72 +5179,72 @@ func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { } /* -GetAttachedVolume: Get Volume Attachment details. +GetNetwork: Get network details. -Get the details of an existing Volume Attachment. +Get details about a network of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetAttachedVolumeRequest + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest */ -func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { - return ApiGetAttachedVolumeRequest{ +func (a *APIClient) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + networkId: networkId, } } -func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { - r := ApiGetAttachedVolumeRequest{ +func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) { + r := ApiGetNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + networkId: networkId, } return r.Execute() } -type ApiGetKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - keypairName string +type ApiGetNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { +func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + localVarReturnValue *NetworkArea ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeyPair") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/keypairs/{keypairName}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.keypairName) > 63 { - return localVarReturnValue, fmt.Errorf("keypairName must have less than 63 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -4080,80 +5367,72 @@ func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { } /* -GetKeyPair: Get key pair details. +GetNetworkArea: Get details about a network area. -Get details about a key pair. +Get details about a network area in an organization. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param keypairName The name of a key pair. - @return ApiGetKeyPairRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest */ -func (a *APIClient) GetKeyPair(ctx context.Context, projectId string, keypairName string) ApiGetKeyPairRequest { - return ApiGetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - keypairName: keypairName, +func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) GetKeyPairExecute(ctx context.Context, projectId string, keypairName string) (*Keypair, error) { - r := ApiGetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - keypairName: keypairName, +func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { + r := ApiGetNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiGetNICRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string +type ApiGetOrganizationRequestRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + requestId string } -func (r ApiGetNICRequest) Execute() (*NIC, error) { +func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *Request ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNIC") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOrganizationRequest") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.nicId) < 36 { - return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.requestId) < 36 { + return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.requestId) > 36 { + return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") } // to determine the Content-Type header @@ -4276,60 +5555,55 @@ func (r ApiGetNICRequest) Execute() (*NIC, error) { } /* -GetNIC: Get details about a network interface. +GetOrganizationRequest: Lookup an organization request ID. -Get details about a network interface inside a network. +Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiGetNICRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest */ -func (a *APIClient) GetNIC(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNICRequest { - return ApiGetNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, } } -func (a *APIClient) GetNICExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { - r := ApiGetNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { + r := ApiGetOrganizationRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, } return r.Execute() } -type ApiGetNetworkRequest struct { +type ApiGetProjectDetailsRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string } -func (r ApiGetNetworkRequest) Execute() (*Network, error) { +func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Network + localVarReturnValue *Project ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectDetails") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4340,12 +5614,6 @@ func (r ApiGetNetworkRequest) Execute() (*Network, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -4467,72 +5735,69 @@ func (r ApiGetNetworkRequest) Execute() (*Network, error) { } /* -GetNetwork: Get network details. +GetProjectDetails: Get project details. -Get details about a network of a project. +Get details about a STACKIT project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiGetNetworkRequest + @return ApiGetProjectDetailsRequest */ -func (a *APIClient) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { - return ApiGetNetworkRequest{ +func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, } } -func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) { - r := ApiGetNetworkRequest{ +func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { + r := ApiGetProjectDetailsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, } return r.Execute() } -type ApiGetNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string +type ApiGetProjectRequestRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + requestId string } -func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { +func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkArea + localVarReturnValue *Request ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkArea") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectRequest") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.requestId) < 36 { + return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.requestId) > 36 { + return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") } // to determine the Content-Type header @@ -4655,72 +5920,72 @@ func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { } /* -GetNetworkArea: Get details about a network area. +GetProjectRequest: Lookup a project request ID. -Get details about a network area in an organization. +Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiGetNetworkAreaRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest */ -func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { - return ApiGetNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + requestId: requestId, } } -func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { - r := ApiGetNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) { + r := ApiGetProjectRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + requestId: requestId, } return r.Execute() } -type ApiGetOrganizationRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - requestId string +type ApiGetPublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + publicIpId string } -func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { +func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Request + localVarReturnValue *PublicIp ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOrganizationRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPublicIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") } // to determine the Content-Type header @@ -4843,55 +6108,57 @@ func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { } /* -GetOrganizationRequest: Lookup an organization request ID. +GetPublicIP: Get details about a public ip. -Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. +Get details about a public ip inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param requestId The identifier (ID) of a STACKIT Request. - @return ApiGetOrganizationRequestRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest */ -func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { - return ApiGetOrganizationRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - requestId: requestId, +func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, } } -func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { - r := ApiGetOrganizationRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - requestId: requestId, +func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { + r := ApiGetPublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, } return r.Execute() } -type ApiGetProjectDetailsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ApiGetSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string } -func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { +func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Project + localVarReturnValue *SecurityGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectDetails") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4902,6 +6169,12 @@ func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5023,54 +6296,59 @@ func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { } /* -GetProjectDetails: Get project details. +GetSecurityGroup: Get security group details. -Get details about a STACKIT project. +Get details about a security group of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiGetProjectDetailsRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest */ -func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { - return ApiGetProjectDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { - r := ApiGetProjectDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { + r := ApiGetSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiGetProjectRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - requestId string +type ApiGetSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + securityGroupRuleId string } -func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { +func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Request + localVarReturnValue *SecurityGroupRule ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroupRule") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/requests/{requestId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5081,11 +6359,17 @@ func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have less than 36 elements") } // to determine the Content-Type header @@ -5208,57 +6492,68 @@ func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { } /* -GetProjectRequest: Lookup a project request ID. +GetSecurityGroupRule: Get security group rule details. -Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. +Get details about a security group rule of a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param requestId The identifier (ID) of a STACKIT Request. - @return ApiGetProjectRequestRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest */ -func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { - return ApiGetProjectRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - requestId: requestId, +func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } } -func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) { - r := ApiGetProjectRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - requestId: requestId, +func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { + r := ApiGetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } return r.Execute() } -type ApiGetPublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string +type ApiGetServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + details *bool +} + +// Show detailed information about server. + +func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r } -func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { +func (r ApiGetServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *Server ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5269,13 +6564,16 @@ func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.publicIpId) < 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5396,57 +6694,57 @@ func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { } /* -GetPublicIP: Get details about a public ip. +GetServer: Get server details. -Get details about a public ip inside a project. +Get details about a server by its ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param publicIpId The identifier (ID) of a Public IP. - @return ApiGetPublicIPRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest */ -func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { - return ApiGetPublicIPRequest{ +func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, + serverId: serverId, } } -func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := ApiGetPublicIPRequest{ +func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { + r := ApiGetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, + serverId: serverId, } return r.Execute() } -type ApiGetSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiGetServerConsoleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { +func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + localVarReturnValue *ServerConsoleUrl ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5457,11 +6755,11 @@ func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -5584,59 +6882,57 @@ func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -GetSecurityGroup: Get security group details. +GetServerConsole: Get server console. -Get details about a security group of a project. +Get a URL for server remote console. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiGetSecurityGroupRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest */ -func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { - return ApiGetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := ApiGetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { + r := ApiGetServerConsoleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiGetSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string +type ApiGetServerGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverGroupId string } -func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { +func (r ApiGetServerGroupRequest) Execute() (*ServerGroup, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRule + localVarReturnValue *ServerGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroupRule") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(r.serverGroupId, "serverGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5647,17 +6943,11 @@ func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } - if strlen(r.securityGroupRuleId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have at least 36 elements") + if strlen(r.serverGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("serverGroupId must have at least 36 elements") } - if strlen(r.securityGroupRuleId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.serverGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("serverGroupId must have less than 36 elements") } // to determine the Content-Type header @@ -5780,66 +7070,63 @@ func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { } /* -GetSecurityGroupRule: Get security group rule details. +GetServerGroup: Get the server group. -Get details about a security group rule of a project. +Get the server group created in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. - @return ApiGetSecurityGroupRuleRequest + @param serverGroupId The identifier (ID) of a STACKIT Server Group. + @return ApiGetServerGroupRequest */ -func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { - return ApiGetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) GetServerGroup(ctx context.Context, projectId string, serverGroupId string) ApiGetServerGroupRequest { + return ApiGetServerGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverGroupId: serverGroupId, } } -func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { - r := ApiGetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) GetServerGroupExecute(ctx context.Context, projectId string, serverGroupId string) (*ServerGroup, error) { + r := ApiGetServerGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverGroupId: serverGroupId, } return r.Execute() } -type ApiGetServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - details *bool +type ApiGetServerLogRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + getServerLogRequest *GetServerLogRequest } -// Show detailed information about server. +// Request the server log. By default the length is limited to 2000 lines. -func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { - r.details = &details +func (r ApiGetServerLogRequest) GetServerLogRequest(getServerLogRequest GetServerLogRequest) ApiGetServerLogRequest { + r.getServerLogRequest = &getServerLogRequest return r } -func (r ApiGetServerRequest) Execute() (*Server, error) { +func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *GetServerLog200Response ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerLog") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/log" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) @@ -5859,11 +7146,8 @@ func (r ApiGetServerRequest) Execute() (*Server, error) { return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } - if r.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -5879,6 +7163,8 @@ func (r ApiGetServerRequest) Execute() (*Server, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.getServerLogRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -5982,17 +7268,17 @@ func (r ApiGetServerRequest) Execute() (*Server, error) { } /* -GetServer: Get server details. +GetServerLog: Get server log. -Get details about a server by its ID. +Get server console log. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerRequest + @return ApiGetServerLogRequest */ -func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { - return ApiGetServerRequest{ +func (a *APIClient) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -6000,8 +7286,8 @@ func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId st } } -func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := ApiGetServerRequest{ +func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) { + r := ApiGetServerLogRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -6010,29 +7296,29 @@ func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serv return r.Execute() } -type ApiGetServerConsoleRequest struct { +type ApiGetVolumeRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string + volumeId string } -func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { +func (r ApiGetVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServerConsoleUrl + localVarReturnValue *Volume ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolume") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6043,11 +7329,11 @@ func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") } // to determine the Content-Type header @@ -6170,65 +7456,57 @@ func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { } /* -GetServerConsole: Get server console. +GetVolume: Get details about a volume. -Get a URL for server remote console. +Get details about a block device volume. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerConsoleRequest + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest */ -func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { - return ApiGetServerConsoleRequest{ +func (a *APIClient) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + volumeId: volumeId, } } -func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { - r := ApiGetServerConsoleRequest{ +func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { + r := ApiGetVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + volumeId: volumeId, } return r.Execute() } -type ApiGetServerLogRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - getServerLogRequest *GetServerLogRequest -} - -// Request the server log. By default the length is limited to 2000 lines. - -func (r ApiGetServerLogRequest) GetServerLogRequest(getServerLogRequest GetServerLogRequest) ApiGetServerLogRequest { - r.getServerLogRequest = &getServerLogRequest - return r +type ApiGetVolumePerformanceClassRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + volumePerformanceClass string } -func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { +func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetServerLog200Response + localVarReturnValue *VolumePerformanceClass ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerLog") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolumePerformanceClass") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/log" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6239,15 +7517,12 @@ func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.volumePerformanceClass) > 63 { + return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 63 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -6263,8 +7538,6 @@ func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.getServerLogRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -6368,57 +7641,57 @@ func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { } /* -GetServerLog: Get server log. +GetVolumePerformanceClass: Get details about a volume performance class. -Get server console log. +Get details about a specific volume performance class. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerLogRequest + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest */ -func (a *APIClient) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { - return ApiGetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumePerformanceClass: volumePerformanceClass, } } -func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) { - r := ApiGetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) { + r := ApiGetVolumePerformanceClassRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumePerformanceClass: volumePerformanceClass, } return r.Execute() } -type ApiGetVolumeRequest struct { +type ApiListAttachedVolumesRequest struct { ctx context.Context apiService *DefaultApiService projectId string - volumeId string + serverId string } -func (r ApiGetVolumeRequest) Execute() (*Volume, error) { +func (r ApiListAttachedVolumesRequest) Execute() (*V1VolumeAttachmentListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *V1VolumeAttachmentListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6429,11 +7702,11 @@ func (r ApiGetVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -6556,71 +7829,69 @@ func (r ApiGetVolumeRequest) Execute() (*Volume, error) { } /* -GetVolume: Get details about a volume. +ListAttachedVolumes: List all volume attachments of a server. -Get details about a block device volume. +Get a list of all volume attachments of a server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetVolumeRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest */ -func (a *APIClient) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { - return ApiGetVolumeRequest{ +func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + serverId: serverId, } } -func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { - r := ApiGetVolumeRequest{ +func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*V1VolumeAttachmentListResponse, error) { + r := ApiListAttachedVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + serverId: serverId, } return r.Execute() } -type ApiGetVolumePerformanceClassRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumePerformanceClass string +type ApiListKeyPairsRequest struct { + ctx context.Context + apiService *DefaultApiService + labelSelector *string } -func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { +// Filter resources by labels. + +func (r ApiListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumePerformanceClass + localVarReturnValue *KeyPairListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolumePerformanceClass") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListKeyPairs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) + localVarPath := localBasePath + "/v1alpha1/keypairs" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.volumePerformanceClass) > 63 { - return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 63 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -6741,57 +8012,59 @@ func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, } /* -GetVolumePerformanceClass: Get details about a volume performance class. +ListKeyPairs: List all SSH keypairs for the requesting user. -Get details about a specific volume performance class. +Get a list of all SSH keypairs assigned to the requesting user. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param volumePerformanceClass The name of a STACKIT Volume performance class. - @return ApiGetVolumePerformanceClassRequest + @return ApiListKeyPairsRequest */ -func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { - return ApiGetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, +func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + apiService: a.defaultApi, + ctx: ctx, } } -func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) { - r := ApiGetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, +func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { + r := ApiListKeyPairsRequest{ + apiService: a.defaultApi, + ctx: ctx, } return r.Execute() } -type ApiListAttachedVolumesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiListNICsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + labelSelector *string } -func (r ApiListAttachedVolumesRequest) Execute() (*V1VolumeAttachmentListResponse, error) { +// Filter resources by labels. + +func (r ApiListNICsRequest) LabelSelector(labelSelector string) ApiListNICsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNICsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *V1VolumeAttachmentListResponse + localVarReturnValue *NICListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNICs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6802,13 +8075,16 @@ func (r ApiListAttachedVolumesRequest) Execute() (*V1VolumeAttachmentListRespons if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -6929,64 +8205,72 @@ func (r ApiListAttachedVolumesRequest) Execute() (*V1VolumeAttachmentListRespons } /* -ListAttachedVolumes: List all volume attachments of a server. +ListNICs: List all network interfaces inside a network. -Get a list of all volume attachments of a server. +Get a list of all network interfaces inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiListAttachedVolumesRequest + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNICsRequest */ -func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { - return ApiListAttachedVolumesRequest{ +func (a *APIClient) ListNICs(ctx context.Context, projectId string, networkId string) ApiListNICsRequest { + return ApiListNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + networkId: networkId, } } -func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*V1VolumeAttachmentListResponse, error) { - r := ApiListAttachedVolumesRequest{ +func (a *APIClient) ListNICsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) { + r := ApiListNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + networkId: networkId, } return r.Execute() } -type ApiListKeyPairsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ApiListNetworkAreaProjectsRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { +func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *KeyPairListResponse + localVarReturnValue *ProjectListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListKeyPairs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaProjects") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/keypairs" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -7109,77 +8393,72 @@ func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { } /* -ListKeyPairs: List all key pairs in a project. +ListNetworkAreaProjects: List all projects using a network area. -Get a list of all key pairs in a project. +Get a list of all projects using a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListKeyPairsRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest */ -func (a *APIClient) ListKeyPairs(ctx context.Context, projectId string) ApiListKeyPairsRequest { - return ApiListKeyPairsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) ListKeyPairsExecute(ctx context.Context, projectId string) (*KeyPairListResponse, error) { - r := ApiListKeyPairsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { + r := ApiListNetworkAreaProjectsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiListNICsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - labelSelector *string +type ApiListNetworkAreasRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + labelSelector *string } // Filter resources by labels. -func (r ApiListNICsRequest) LabelSelector(labelSelector string) ApiListNICsRequest { +func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { r.labelSelector = &labelSelector return r } -func (r ApiListNICsRequest) Execute() (*NICListResponse, error) { +func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NICListResponse + localVarReturnValue *NetworkAreaListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNICs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreas") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } if r.labelSelector != nil { @@ -7305,74 +8584,74 @@ func (r ApiListNICsRequest) Execute() (*NICListResponse, error) { } /* -ListNICs: List all network interfaces inside a network. +ListNetworkAreas: List all network areas in an organization. -Get a list of all network interfaces inside a network. +Get a list of all visible network areas defined in an organization. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiListNICsRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest */ -func (a *APIClient) ListNICs(ctx context.Context, projectId string, networkId string) ApiListNICsRequest { - return ApiListNICsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, } } -func (a *APIClient) ListNICsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) { - r := ApiListNICsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { + r := ApiListNetworkAreasRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, } return r.Execute() } -type ApiListNetworkAreaProjectsRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string +type ApiListNetworksRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { +// Filter resources by labels. + +func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ProjectListResponse + localVarReturnValue *NetworkListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaProjects") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -7493,77 +8772,55 @@ func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, erro } /* -ListNetworkAreaProjects: List all projects using a network area. +ListNetworks: List all networks inside a project. -Get a list of all projects using a network area. +Get a list of all networks inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaProjectsRequest + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListNetworksRequest */ -func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { - return ApiListNetworkAreaProjectsRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { - r := ApiListNetworkAreaProjectsRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) { + r := ApiListNetworksRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiListNetworkAreasRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { - r.labelSelector = &labelSelector - return r +type ApiListPublicIPRangesRequest struct { + ctx context.Context + apiService *DefaultApiService } -func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { +func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkAreaListResponse + localVarReturnValue *PublicNetworkListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreas") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPRanges") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath := localBasePath + "/v1alpha1/networks/public-ip-ranges" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -7684,32 +8941,29 @@ func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) } /* -ListNetworkAreas: List all network areas in an organization. +ListPublicIPRanges: List all public ip ranges. -Get a list of all visible network areas defined in an organization. +Get a list of all public ip ranges that STACKIT uses. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @return ApiListNetworkAreasRequest + @return ApiListPublicIPRangesRequest */ -func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { - return ApiListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + apiService: a.defaultApi, + ctx: ctx, } } -func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { - r := ApiListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { + r := ApiListPublicIPRangesRequest{ + apiService: a.defaultApi, + ctx: ctx, } return r.Execute() } -type ApiListNetworksRequest struct { +type ApiListPublicIPsRequest struct { ctx context.Context apiService *DefaultApiService projectId string @@ -7718,25 +8972,25 @@ type ApiListNetworksRequest struct { // Filter resources by labels. -func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { +func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { r.labelSelector = &labelSelector return r } -func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { +func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkListResponse + localVarReturnValue *PublicIpListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -7872,24 +9126,24 @@ func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { } /* -ListNetworks: List all networks inside a project. +ListPublicIPs: List all public ips inside a project. -Get a list of all networks inside a project. +Get a list of all public ips inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListNetworksRequest + @return ApiListPublicIPsRequest */ -func (a *APIClient) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { - return ApiListNetworksRequest{ +func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) { - r := ApiListNetworksRequest{ +func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) { + r := ApiListPublicIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -7897,35 +9151,29 @@ func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) ( return r.Execute() } -type ApiListPublicIPsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { - r.labelSelector = &labelSelector - return r +type ApiListSecurityGroupRulesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string } -func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { +func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIpListResponse + localVarReturnValue *SecurityGroupRuleListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroupRules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -7936,10 +9184,13 @@ func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8060,54 +9311,63 @@ func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { } /* -ListPublicIPs: List all public ips inside a project. +ListSecurityGroupRules: List all rules for a security group. -Get a list of all public ips inside a project. +Get a list of all rules inside a security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListPublicIPsRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest */ -func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { - return ApiListPublicIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) { - r := ApiListPublicIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { + r := ApiListSecurityGroupRulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiListSecurityGroupRulesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiListSecurityGroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { +// Filter resources by labels. + +func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRuleListResponse + localVarReturnValue *SecurityGroupListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroupRules") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -8118,13 +9378,10 @@ func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListRespo if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8245,62 +9502,51 @@ func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListRespo } /* -ListSecurityGroupRules: List all rules for a security group. +ListSecurityGroups: List all security groups inside a project. -Get a list of all rules inside a security group. +Get a list of all security groups inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiListSecurityGroupRulesRequest + @return ApiListSecurityGroupsRequest */ -func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { - return ApiListSecurityGroupRulesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { - r := ApiListSecurityGroupRulesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) { + r := ApiListSecurityGroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiListSecurityGroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { - r.labelSelector = &labelSelector - return r +type ApiListServerGroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string } -func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { +func (r ApiListServerGroupsRequest) Execute() (*ServerGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupListResponse + localVarReturnValue *ServerGroupListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroups") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerGroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -8313,9 +9559,6 @@ func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, err return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8409,6 +9652,17 @@ func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, err newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -8436,24 +9690,24 @@ func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, err } /* -ListSecurityGroups: List all security groups inside a project. +ListServerGroups: Get the server groups setup for a project. -Get a list of all security groups inside a project. +Get the server groups created in a project. Server groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListSecurityGroupsRequest + @return ApiListServerGroupsRequest */ -func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { - return ApiListSecurityGroupsRequest{ +func (a *APIClient) ListServerGroups(ctx context.Context, projectId string) ApiListServerGroupsRequest { + return ApiListServerGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) { - r := ApiListSecurityGroupsRequest{ +func (a *APIClient) ListServerGroupsExecute(ctx context.Context, projectId string) (*ServerGroupListResponse, error) { + r := ApiListServerGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -10426,6 +11680,9 @@ func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMail if strlen(r.serverId) > 36 { return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -12164,63 +13421,44 @@ func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId s return r.Execute() } -type ApiUpdateNICRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string - updateNICPayload *UpdateNICPayload +type ApiUpdateKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string + updateKeyPairPayload *UpdateKeyPairPayload } -// Request an Update of a network interface. +// Request an update of an SSH keypair. -func (r ApiUpdateNICRequest) UpdateNICPayload(updateNICPayload UpdateNICPayload) ApiUpdateNICRequest { - r.updateNICPayload = &updateNICPayload +func (r ApiUpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { + r.updateKeyPairPayload = &updateKeyPairPayload return r } -func (r ApiUpdateNICRequest) Execute() (*NIC, error) { +func (r ApiUpdateKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *Keypair ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNIC") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateKeyPair") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath := localBasePath + "/v1alpha1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + if strlen(r.keypairName) > 127 { + return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } - if strlen(r.nicId) < 36 { - return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") - } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") - } - if r.updateNICPayload == nil { - return localVarReturnValue, fmt.Errorf("updateNICPayload is required and must be specified") + if r.updateKeyPairPayload == nil { + return localVarReturnValue, fmt.Errorf("updateKeyPairPayload is required and must be specified") } // to determine the Content-Type header @@ -12241,7 +13479,7 @@ func (r ApiUpdateNICRequest) Execute() (*NIC, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateNICPayload + localVarPostBody = r.updateKeyPairPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -12318,17 +13556,6 @@ func (r ApiUpdateNICRequest) Execute() (*NIC, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -12356,68 +13583,64 @@ func (r ApiUpdateNICRequest) Execute() (*NIC, error) { } /* -UpdateNIC: Update a network interface. +UpdateKeyPair: Update information of an SSH keypair. -Update the properties of an existing network interface inside a network. +Update labels of the SSH keypair. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiUpdateNICRequest + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest */ -func (a *APIClient) UpdateNIC(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNICRequest { - return ApiUpdateNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } } -func (a *APIClient) UpdateNICExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { - r := ApiUpdateNICRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { + r := ApiUpdateKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } return r.Execute() } -type ApiUpdatePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string - updatePublicIPPayload *UpdatePublicIPPayload +type ApiUpdateNICRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + nicId string + updateNICPayload *UpdateNICPayload } -// Request an Update of a public IP. +// Request an Update of a network interface. -func (r ApiUpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { - r.updatePublicIPPayload = &updatePublicIPPayload +func (r ApiUpdateNICRequest) UpdateNICPayload(updateNICPayload UpdateNICPayload) ApiUpdateNICRequest { + r.updateNICPayload = &updateNICPayload return r } -func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { +func (r ApiUpdateNICRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *NIC ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdatePublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateNIC") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -12428,14 +13651,20 @@ func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.publicIpId) < 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } - if r.updatePublicIPPayload == nil { - return localVarReturnValue, fmt.Errorf("updatePublicIPPayload is required and must be specified") + if strlen(r.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") + } + if r.updateNICPayload == nil { + return localVarReturnValue, fmt.Errorf("updateNICPayload is required and must be specified") } // to determine the Content-Type header @@ -12456,7 +13685,7 @@ func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updatePublicIPPayload + localVarPostBody = r.updateNICPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -12533,6 +13762,17 @@ func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -12560,65 +13800,68 @@ func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { } /* -UpdatePublicIP: Update a public ip. +UpdateNIC: Update a network interface. -Update the properties of an existing public ip inside a project. +Update the properties of an existing network interface inside a network. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param publicIpId The identifier (ID) of a Public IP. - @return ApiUpdatePublicIPRequest + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNICRequest */ -func (a *APIClient) UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest { - return ApiUpdatePublicIPRequest{ +func (a *APIClient) UpdateNIC(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNICRequest { + return ApiUpdateNICRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, + networkId: networkId, + nicId: nicId, } } -func (a *APIClient) UpdatePublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := ApiUpdatePublicIPRequest{ +func (a *APIClient) UpdateNICExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { + r := ApiUpdateNICRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type ApiUpdateVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string - updateVolumePayload *UpdateVolumePayload +type ApiUpdatePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + publicIpId string + updatePublicIPPayload *UpdatePublicIPPayload } -// Request an update of a volume. +// Request an Update of a public IP. -func (r ApiUpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { - r.updateVolumePayload = &updateVolumePayload +func (r ApiUpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { + r.updatePublicIPPayload = &updatePublicIPPayload return r } -func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { +func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *PublicIp ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdatePublicIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -12629,14 +13872,14 @@ func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") } - if r.updateVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("updateVolumePayload is required and must be specified") + if r.updatePublicIPPayload == nil { + return localVarReturnValue, fmt.Errorf("updatePublicIPPayload is required and must be specified") } // to determine the Content-Type header @@ -12657,7 +13900,7 @@ func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateVolumePayload + localVarPostBody = r.updatePublicIPPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -12761,57 +14004,65 @@ func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { } /* -UpdateVolume: Update information of a volume. +UpdatePublicIP: Update a public ip. -Update name, description or labels of the volume. +Update the properties of an existing public ip inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiUpdateVolumeRequest + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest */ -func (a *APIClient) UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest { - return ApiUpdateVolumeRequest{ +func (a *APIClient) UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + publicIpId: publicIpId, } } -func (a *APIClient) UpdateVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { - r := ApiUpdateVolumeRequest{ +func (a *APIClient) UpdatePublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { + r := ApiUpdatePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + publicIpId: publicIpId, } return r.Execute() } -type ApiV1alpha1GetOpenStackNetworkDetailsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string +type ApiUpdateSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + updateSecurityGroupPayload *UpdateSecurityGroupPayload +} + +// Request an update of a security group. + +func (r ApiUpdateSecurityGroupRequest) UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest { + r.updateSecurityGroupPayload = &updateSecurityGroupPayload + return r } -func (r ApiV1alpha1GetOpenStackNetworkDetailsRequest) Execute() (*OpenStackNetwork, error) { +func (r ApiUpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *OpenStackNetwork + localVarReturnValue *SecurityGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.V1alpha1GetOpenStackNetworkDetails") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateSecurityGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/openstack-networks/{networkId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -12822,15 +14073,18 @@ func (r ApiV1alpha1GetOpenStackNetworkDetailsRequest) Execute() (*OpenStackNetwo if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } + if r.updateSecurityGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("updateSecurityGroupPayload 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) @@ -12846,6 +14100,8 @@ func (r ApiV1alpha1GetOpenStackNetworkDetailsRequest) Execute() (*OpenStackNetwo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateSecurityGroupPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -12949,68 +14205,65 @@ func (r ApiV1alpha1GetOpenStackNetworkDetailsRequest) Execute() (*OpenStackNetwo } /* -V1alpha1GetOpenStackNetworkDetails: Get OpenStack network details (DEPRECATED). +UpdateSecurityGroup: Update information of a security group. -Deprecated: Get OpenStack details about a network (DEPRECATED). +Update labels of the security group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiV1alpha1GetOpenStackNetworkDetailsRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiUpdateSecurityGroupRequest */ -func (a *APIClient) V1alpha1GetOpenStackNetworkDetails(ctx context.Context, projectId string, networkId string) ApiV1alpha1GetOpenStackNetworkDetailsRequest { - return ApiV1alpha1GetOpenStackNetworkDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { + return ApiUpdateSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -/* -Deprecated: Get OpenStack details about a network (DEPRECATED). -*/ -func (a *APIClient) V1alpha1GetOpenStackNetworkDetailsExecute(ctx context.Context, projectId string, networkId string) (*OpenStackNetwork, error) { - r := ApiV1alpha1GetOpenStackNetworkDetailsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { + r := ApiUpdateSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiV1alpha1UpdateSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - v1alpha1UpdateSecurityGroupPayload *V1alpha1UpdateSecurityGroupPayload +type ApiUpdateServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + updateServerPayload *UpdateServerPayload } -// Request an update of a security group. +// Request an update of a server. -func (r ApiV1alpha1UpdateSecurityGroupRequest) V1alpha1UpdateSecurityGroupPayload(v1alpha1UpdateSecurityGroupPayload V1alpha1UpdateSecurityGroupPayload) ApiV1alpha1UpdateSecurityGroupRequest { - r.v1alpha1UpdateSecurityGroupPayload = &v1alpha1UpdateSecurityGroupPayload +func (r ApiUpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { + r.updateServerPayload = &updateServerPayload return r } -func (r ApiV1alpha1UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { +func (r ApiUpdateServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + localVarReturnValue *Server ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.V1alpha1UpdateSecurityGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13021,14 +14274,14 @@ func (r ApiV1alpha1UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } - if r.v1alpha1UpdateSecurityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("v1alpha1UpdateSecurityGroupPayload is required and must be specified") + if r.updateServerPayload == nil { + return localVarReturnValue, fmt.Errorf("updateServerPayload is required and must be specified") } // to determine the Content-Type header @@ -13049,7 +14302,7 @@ func (r ApiV1alpha1UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.v1alpha1UpdateSecurityGroupPayload + localVarPostBody = r.updateServerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -13153,65 +14406,65 @@ func (r ApiV1alpha1UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) } /* -V1alpha1UpdateSecurityGroup: Update information of a security group. +UpdateServer: Update information of a server. -Update labels of the security group. +Update name or labels of the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiV1alpha1UpdateSecurityGroupRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest */ -func (a *APIClient) V1alpha1UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiV1alpha1UpdateSecurityGroupRequest { - return ApiV1alpha1UpdateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) V1alpha1UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := ApiV1alpha1UpdateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { + r := ApiUpdateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiV1alpha1UpdateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - v1alpha1UpdateServerPayload *V1alpha1UpdateServerPayload +type ApiUpdateVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + volumeId string + updateVolumePayload *UpdateVolumePayload } -// Request an update of a server. +// Request an update of a volume. -func (r ApiV1alpha1UpdateServerRequest) V1alpha1UpdateServerPayload(v1alpha1UpdateServerPayload V1alpha1UpdateServerPayload) ApiV1alpha1UpdateServerRequest { - r.v1alpha1UpdateServerPayload = &v1alpha1UpdateServerPayload +func (r ApiUpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { + r.updateVolumePayload = &updateVolumePayload return r } -func (r ApiV1alpha1UpdateServerRequest) Execute() (*Server, error) { +func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *Volume ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.V1alpha1UpdateServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateVolume") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13222,14 +14475,14 @@ func (r ApiV1alpha1UpdateServerRequest) Execute() (*Server, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") } - if r.v1alpha1UpdateServerPayload == nil { - return localVarReturnValue, fmt.Errorf("v1alpha1UpdateServerPayload is required and must be specified") + if r.updateVolumePayload == nil { + return localVarReturnValue, fmt.Errorf("updateVolumePayload is required and must be specified") } // to determine the Content-Type header @@ -13250,7 +14503,7 @@ func (r ApiV1alpha1UpdateServerRequest) Execute() (*Server, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.v1alpha1UpdateServerPayload + localVarPostBody = r.updateVolumePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -13354,30 +14607,30 @@ func (r ApiV1alpha1UpdateServerRequest) Execute() (*Server, error) { } /* -V1alpha1UpdateServer: Update information of a server. +UpdateVolume: Update information of a volume. -Update name or labels of the server. +Update name, description or labels of the volume. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiV1alpha1UpdateServerRequest + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest */ -func (a *APIClient) V1alpha1UpdateServer(ctx context.Context, projectId string, serverId string) ApiV1alpha1UpdateServerRequest { - return ApiV1alpha1UpdateServerRequest{ +func (a *APIClient) UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + volumeId: volumeId, } } -func (a *APIClient) V1alpha1UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := ApiV1alpha1UpdateServerRequest{ +func (a *APIClient) UpdateVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { + r := ApiUpdateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + volumeId: volumeId, } return r.Execute() } diff --git a/services/iaasalpha/api_default_test.go b/services/iaasalpha/api_default_test.go index 6096aa031..79045d6a4 100644 --- a/services/iaasalpha/api_default_test.go +++ b/services/iaasalpha/api_default_test.go @@ -347,6 +347,56 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService CreateKeyPair", func(t *testing.T) { + path := "/v1alpha1/keypairs" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Keypair{} + 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 iaasalpha_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) + } + + createKeyPairPayload := CreateKeyPairPayload{} + + resp, reqErr := apiClient.CreateKeyPair(context.Background()).CreateKeyPairPayload(createKeyPairPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService CreateNIC", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" projectIdValue := "projectId" @@ -618,6 +668,59 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService CreateServerGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/server-groups" + 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 := ServerGroup{} + 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 iaasalpha_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" + createServerGroupPayload := CreateServerGroupPayload{} + + resp, reqErr := apiClient.CreateServerGroup(context.Background(), projectId).CreateServerGroupPayload(createServerGroupPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService CreateVolume", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/volumes" projectIdValue := "projectId" @@ -720,6 +823,52 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { + path := "/v1alpha1/keypairs/{keypairName}" + keypairNameValue := "keypairName" + path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + }) + 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 iaasalpha_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) + } + + keypairName := "keypairName" + + reqErr := apiClient.DeleteKeyPair(context.Background(), keypairName).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + t.Run("Test DefaultApiService DeleteNIC", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" projectIdValue := "projectId" @@ -971,6 +1120,55 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService DeleteServerGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverGroupIdValue := "serverGroupId" + path = strings.Replace(path, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(serverGroupIdValue, "serverGroupId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + }) + 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 iaasalpha_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" + serverGroupId := "serverGroupId" + + reqErr := apiClient.DeleteServerGroup(context.Background(), projectId, serverGroupId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" projectIdValue := "projectId" @@ -1079,9 +1277,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetKeyPair", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/keypairs/{keypairName}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + path := "/v1alpha1/keypairs/{keypairName}" keypairNameValue := "keypairName" path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) @@ -1120,10 +1316,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" keypairName := "keypairName" - resp, reqErr := apiClient.GetKeyPair(context.Background(), projectId, keypairName).Execute() + resp, reqErr := apiClient.GetKeyPair(context.Background(), keypairName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1741,6 +1936,61 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService GetServerGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverGroupIdValue := "serverGroupId" + path = strings.Replace(path, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(serverGroupIdValue, "serverGroupId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ServerGroup{} + 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 iaasalpha_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" + serverGroupId := "serverGroupId" + + resp, reqErr := apiClient.GetServerGroup(context.Background(), projectId, serverGroupId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService GetServerLog", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/servers/{serverId}/log" projectIdValue := "projectId" @@ -1962,9 +2212,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListKeyPairs", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/keypairs" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + path := "/v1alpha1/keypairs" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -2001,9 +2249,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - - resp, reqErr := apiClient.ListKeyPairs(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListKeyPairs(context.Background()).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2227,6 +2473,54 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService ListPublicIPRanges", func(t *testing.T) { + path := "/v1alpha1/networks/public-ip-ranges" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := PublicNetworkListResponse{} + 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 iaasalpha_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) + } + + resp, reqErr := apiClient.ListPublicIPRanges(context.Background()).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService ListPublicIPs", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/public-ips" projectIdValue := "projectId" @@ -2386,6 +2680,58 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService ListServerGroups", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/server-groups" + 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 := ServerGroupListResponse{} + 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 iaasalpha_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.ListServerGroups(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService ListServerNICs", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" projectIdValue := "projectId" @@ -3374,18 +3720,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateNIC", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + t.Run("Test DefaultApiService UpdateKeyPair", func(t *testing.T) { + path := "/v1alpha1/keypairs/{keypairName}" + keypairNameValue := "keypairName" + path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NIC{} + data := Keypair{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3418,12 +3760,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" - nicId := "nicId" - updateNICPayload := UpdateNICPayload{} + keypairName := "keypairName" + updateKeyPairPayload := UpdateKeyPairPayload{} - resp, reqErr := apiClient.UpdateNIC(context.Background(), projectId, networkId, nicId).UpdateNICPayload(updateNICPayload).Execute() + resp, reqErr := apiClient.UpdateKeyPair(context.Background(), keypairName).UpdateKeyPairPayload(updateKeyPairPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3433,16 +3773,18 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdatePublicIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + t.Run("Test DefaultApiService UpdateNIC", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := "nicId" + path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := PublicIp{} + data := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3476,10 +3818,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - publicIpId := "publicIpId" - updatePublicIPPayload := UpdatePublicIPPayload{} + networkId := "networkId" + nicId := "nicId" + updateNICPayload := UpdateNICPayload{} - resp, reqErr := apiClient.UpdatePublicIP(context.Background(), projectId, publicIpId).UpdatePublicIPPayload(updatePublicIPPayload).Execute() + resp, reqErr := apiClient.UpdateNIC(context.Background(), projectId, networkId, nicId).UpdateNICPayload(updateNICPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3489,16 +3832,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + t.Run("Test DefaultApiService UpdatePublicIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + publicIpIdValue := "publicIpId" + path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Volume{} + data := PublicIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3532,10 +3875,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - volumeId := "volumeId" - updateVolumePayload := UpdateVolumePayload{} + publicIpId := "publicIpId" + updatePublicIPPayload := UpdatePublicIPPayload{} - resp, reqErr := apiClient.UpdateVolume(context.Background(), projectId, volumeId).UpdateVolumePayload(updateVolumePayload).Execute() + resp, reqErr := apiClient.UpdatePublicIP(context.Background(), projectId, publicIpId).UpdatePublicIPPayload(updatePublicIPPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3545,16 +3888,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService V1alpha1GetOpenStackNetworkDetails", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/openstack-networks/{networkId}" + t.Run("Test DefaultApiService UpdateSecurityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := OpenStackNetwork{} + data := SecurityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3588,9 +3931,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - networkId := "networkId" + securityGroupId := "securityGroupId" + updateSecurityGroupPayload := UpdateSecurityGroupPayload{} - resp, reqErr := apiClient.V1alpha1GetOpenStackNetworkDetails(context.Background(), projectId, networkId).Execute() + resp, reqErr := apiClient.UpdateSecurityGroup(context.Background(), projectId, securityGroupId).UpdateSecurityGroupPayload(updateSecurityGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3600,16 +3944,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService V1alpha1UpdateSecurityGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + t.Run("Test DefaultApiService UpdateServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroup{} + data := Server{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3643,10 +3987,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - securityGroupId := "securityGroupId" - v1alpha1UpdateSecurityGroupPayload := V1alpha1UpdateSecurityGroupPayload{} + serverId := "serverId" + updateServerPayload := UpdateServerPayload{} - resp, reqErr := apiClient.V1alpha1UpdateSecurityGroup(context.Background(), projectId, securityGroupId).V1alpha1UpdateSecurityGroupPayload(v1alpha1UpdateSecurityGroupPayload).Execute() + resp, reqErr := apiClient.UpdateServer(context.Background(), projectId, serverId).UpdateServerPayload(updateServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3656,16 +4000,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService V1alpha1UpdateServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}" + t.Run("Test DefaultApiService UpdateVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Server{} + data := Volume{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3699,10 +4043,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - v1alpha1UpdateServerPayload := V1alpha1UpdateServerPayload{} + volumeId := "volumeId" + updateVolumePayload := UpdateVolumePayload{} - resp, reqErr := apiClient.V1alpha1UpdateServer(context.Background(), projectId, serverId).V1alpha1UpdateServerPayload(v1alpha1UpdateServerPayload).Execute() + resp, reqErr := apiClient.UpdateVolume(context.Background(), projectId, volumeId).UpdateVolumePayload(updateVolumePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/iaasalpha/go.mod b/services/iaasalpha/go.mod index 2e9d606df..53dee80e3 100644 --- a/services/iaasalpha/go.mod +++ b/services/iaasalpha/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/google/go-cmp v0.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.14.0 + github.com/stackitcloud/stackit-sdk-go/core v0.13.0 ) require ( diff --git a/services/iaasalpha/go.sum b/services/iaasalpha/go.sum index 32bda1722..62f3cf6f4 100644 --- a/services/iaasalpha/go.sum +++ b/services/iaasalpha/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.14.0 h1:oBwwzrEHDTlZpRoQwmMQpNA8bWciTrtGkiN29nx14Z0= -github.com/stackitcloud/stackit-sdk-go/core v0.14.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= +github.com/stackitcloud/stackit-sdk-go/core v0.13.0 h1:BtJT2WXqZdexPPQi/HPUIr8g4JUPOCheh6J9dxiCQ4Q= +github.com/stackitcloud/stackit-sdk-go/core v0.13.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw= diff --git a/services/iaasalpha/model_create_key_pair_payload.go b/services/iaasalpha/model_create_key_pair_payload.go new file mode 100644 index 000000000..9810a9a50 --- /dev/null +++ b/services/iaasalpha/model_create_key_pair_payload.go @@ -0,0 +1,24 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. +type CreateKeyPairPayload struct { + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty"` + // Object that represents the labels of an object. + Labels *map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty"` + // Object that represents a public SSH key. + // REQUIRED + PublicKey *string `json:"publicKey"` +} diff --git a/services/iaasalpha/model_create_server_group_payload.go b/services/iaasalpha/model_create_server_group_payload.go new file mode 100644 index 000000000..b4340e463 --- /dev/null +++ b/services/iaasalpha/model_create_server_group_payload.go @@ -0,0 +1,25 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// CreateServerGroupPayload Definition of a server group. +type CreateServerGroupPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty"` + // The servers that are part of the server group. + Members *[]string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + // REQUIRED + Name *string `json:"name"` + // The server group policy. + // REQUIRED + Policy *string `json:"policy"` +} diff --git a/services/iaasalpha/model_create_server_payload.go b/services/iaasalpha/model_create_server_payload.go index 70e7ff9b5..ba7ae8da4 100644 --- a/services/iaasalpha/model_create_server_payload.go +++ b/services/iaasalpha/model_create_server_payload.go @@ -26,9 +26,9 @@ type CreateServerPayload struct { // Universally Unique Identifier (UUID). Id *string `json:"id,omitempty"` // Universally Unique Identifier (UUID). - Image *string `json:"image,omitempty"` + ImageId *string `json:"imageId,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Keypair *string `json:"keypair,omitempty"` + KeypairName *string `json:"keypairName,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // Date-time when resource was launched. diff --git a/services/iaasalpha/model_key_pair_list_response.go b/services/iaasalpha/model_key_pair_list_response.go index 675263d82..5870f5d42 100644 --- a/services/iaasalpha/model_key_pair_list_response.go +++ b/services/iaasalpha/model_key_pair_list_response.go @@ -10,9 +10,9 @@ API version: 1alpha1 package iaasalpha -// KeyPairListResponse Key pair list response. +// KeyPairListResponse SSH keypair list response. type KeyPairListResponse struct { - // A list of key pairs. + // A list of SSH keypairs. // REQUIRED Items *[]Keypair `json:"items"` } diff --git a/services/iaasalpha/model_keypair.go b/services/iaasalpha/model_keypair.go index f034ecf00..9452ade20 100644 --- a/services/iaasalpha/model_keypair.go +++ b/services/iaasalpha/model_keypair.go @@ -10,11 +10,13 @@ API version: 1alpha1 package iaasalpha -// Keypair Object that represents the public key of a SSH key pair and its name. +// Keypair Object that represents the public key of an SSH keypair and its name. type Keypair struct { + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. Name *string `json:"name,omitempty"` // Object that represents a public SSH key. // REQUIRED diff --git a/services/iaasalpha/model_open_stack_network.go b/services/iaasalpha/model_open_stack_network.go deleted file mode 100644 index c7a371f11..000000000 --- a/services/iaasalpha/model_open_stack_network.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -// OpenStackNetwork Object that represents a network in OpenStack. -type OpenStackNetwork struct { - // Classless Inter-Domain Routing (CIDR). - // REQUIRED - Cidr *string `json:"cidr"` - // Universally Unique Identifier (UUID). - // REQUIRED - OpenstackNetworkID *string `json:"openstackNetworkID"` - // Universally Unique Identifier (UUID). - // REQUIRED - OpenstackRouterID *string `json:"openstackRouterID"` - // Universally Unique Identifier (UUID). - // REQUIRED - OpenstackSubnetID *string `json:"openstackSubnetID"` -} diff --git a/services/iaasalpha/model_public_network_list_response.go b/services/iaasalpha/model_public_network_list_response.go new file mode 100644 index 000000000..0a7faae72 --- /dev/null +++ b/services/iaasalpha/model_public_network_list_response.go @@ -0,0 +1,18 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// PublicNetworkListResponse Public network list response. +type PublicNetworkListResponse struct { + // A list of public networks. + // REQUIRED + Items *[]V1PublicNetwork `json:"items"` +} diff --git a/services/iaasalpha/model_server.go b/services/iaasalpha/model_server.go index 347783b04..ef1831ff3 100644 --- a/services/iaasalpha/model_server.go +++ b/services/iaasalpha/model_server.go @@ -26,9 +26,9 @@ type Server struct { // Universally Unique Identifier (UUID). Id *string `json:"id,omitempty"` // Universally Unique Identifier (UUID). - Image *string `json:"image,omitempty"` + ImageId *string `json:"imageId,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Keypair *string `json:"keypair,omitempty"` + KeypairName *string `json:"keypairName,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // Date-time when resource was launched. diff --git a/services/iaasalpha/model_server_group.go b/services/iaasalpha/model_server_group.go new file mode 100644 index 000000000..23af198f6 --- /dev/null +++ b/services/iaasalpha/model_server_group.go @@ -0,0 +1,25 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// ServerGroup Definition of a server group. +type ServerGroup struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty"` + // The servers that are part of the server group. + Members *[]string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + // REQUIRED + Name *string `json:"name"` + // The server group policy. + // REQUIRED + Policy *string `json:"policy"` +} diff --git a/services/iaasalpha/model_server_group_list_response.go b/services/iaasalpha/model_server_group_list_response.go new file mode 100644 index 000000000..b1d1a4cd8 --- /dev/null +++ b/services/iaasalpha/model_server_group_list_response.go @@ -0,0 +1,18 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// ServerGroupListResponse Response object for server-group list request. +type ServerGroupListResponse struct { + // A list of servers-groups. + // REQUIRED + Items *[]ServerGroup `json:"items"` +} diff --git a/services/iaasalpha/model_update_key_pair_payload.go b/services/iaasalpha/model_update_key_pair_payload.go new file mode 100644 index 000000000..6bdf95ef0 --- /dev/null +++ b/services/iaasalpha/model_update_key_pair_payload.go @@ -0,0 +1,17 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. +type UpdateKeyPairPayload struct { + // Object that represents the labels of an object. + Labels *map[string]interface{} `json:"labels,omitempty"` +} diff --git a/services/iaasalpha/model_update_nic_payload.go b/services/iaasalpha/model_update_nic_payload.go index 60b397eda..fa577485d 100644 --- a/services/iaasalpha/model_update_nic_payload.go +++ b/services/iaasalpha/model_update_nic_payload.go @@ -10,30 +10,16 @@ API version: 1alpha1 package iaasalpha -// UpdateNICPayload Object that represents a network interface. +// UpdateNICPayload Object that represents a network interface update. type UpdateNICPayload struct { // A list of IPs or CIDR notations. AllowedAddresses *[]AllowedAddressesInner `json:"allowedAddresses,omitempty"` - // Universally Unique Identifier (UUID). - Device *string `json:"device,omitempty"` - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` - // Object that represents an IP address. - Ipv4 *string `json:"ipv4,omitempty"` - // Object that represents an IPv6 address. - Ipv6 *string `json:"ipv6,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` - // Object that represents an MAC address. - Mac *string `json:"mac,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name *string `json:"name,omitempty"` - // Universally Unique Identifier (UUID). - NetworkId *string `json:"networkId,omitempty"` // If this is set to false, then no security groups will apply to this network interface. NicSecurity *bool `json:"nicSecurity,omitempty"` // A list of UUIDs. SecurityGroups *[]string `json:"securityGroups,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` } diff --git a/services/iaasalpha/model_v1alpha1_update_security_group_payload.go b/services/iaasalpha/model_update_security_group_payload.go similarity index 77% rename from services/iaasalpha/model_v1alpha1_update_security_group_payload.go rename to services/iaasalpha/model_update_security_group_payload.go index 0ff070770..93641b364 100644 --- a/services/iaasalpha/model_v1alpha1_update_security_group_payload.go +++ b/services/iaasalpha/model_update_security_group_payload.go @@ -10,8 +10,8 @@ API version: 1alpha1 package iaasalpha -// V1alpha1UpdateSecurityGroupPayload Object that represents an update request body of a security group. -type V1alpha1UpdateSecurityGroupPayload struct { +// UpdateSecurityGroupPayload Object that represents an update request body of a security group. +type UpdateSecurityGroupPayload struct { // Description Object. Allows string up to 127 Characters. Description *string `json:"description,omitempty"` // Object that represents the labels of an object. diff --git a/services/iaasalpha/model_v1alpha1_update_server_payload.go b/services/iaasalpha/model_update_server_payload.go similarity index 75% rename from services/iaasalpha/model_v1alpha1_update_server_payload.go rename to services/iaasalpha/model_update_server_payload.go index ad3d1c187..5b2e64ceb 100644 --- a/services/iaasalpha/model_v1alpha1_update_server_payload.go +++ b/services/iaasalpha/model_update_server_payload.go @@ -10,8 +10,8 @@ API version: 1alpha1 package iaasalpha -// V1alpha1UpdateServerPayload Object that represents an update request body of a server. -type V1alpha1UpdateServerPayload struct { +// UpdateServerPayload Object that represents an update request body of a server. +type UpdateServerPayload struct { // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. diff --git a/services/iaasalpha/model_v1_public_network.go b/services/iaasalpha/model_v1_public_network.go new file mode 100644 index 000000000..be089363b --- /dev/null +++ b/services/iaasalpha/model_v1_public_network.go @@ -0,0 +1,18 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +// V1PublicNetwork Public network. +type V1PublicNetwork struct { + // Classless Inter-Domain Routing (CIDR). + // REQUIRED + Cidr *string `json:"cidr"` +}