diff --git a/v1/api/swagger/components/schemas/HostUsageEntry.yaml b/v1/api/swagger/components/schemas/HostUsageEntry.yaml deleted file mode 100644 index 9bde8e1e..00000000 --- a/v1/api/swagger/components/schemas/HostUsageEntry.yaml +++ /dev/null @@ -1,24 +0,0 @@ -allOf: - - $ref: ./UsageEntryBase.yaml - - type: object - required: - - MachineSizeName - - MachineSizeID - - HostName - - HostID - properties: - MachineSizeName: - type: string - example: HPE-Large - description: Name of the MachineSize requested when host was created - MachineSizeID: - type: string - format: uuid - description: Unique ID of the MachineSize requested when host was created - HostName: - type: string - description: Name of the associated Host - HostID: - type: string - format: uuid - description: Unique ID of the associated Host diff --git a/v1/api/swagger/components/schemas/UsageEntryBase.yaml b/v1/api/swagger/components/schemas/UsageEntryBase.yaml deleted file mode 100644 index 1f1e94ad..00000000 --- a/v1/api/swagger/components/schemas/UsageEntryBase.yaml +++ /dev/null @@ -1,47 +0,0 @@ -type: object -required: - - ProjectID - - LocationID - - Allocated - - Ready - - Freed - - UsageStart - - UsageEnd - - UsageHours - - Error -properties: - ProjectID: - type: string - format: uuid - description: Project ID that contained the host - LocationID: - $ref: ./LocationID.yaml - Allocated: - type: string - format: date-time - description: Timestamp of when resource (machine or storage) was allocated - Ready: - type: string - format: date-time - description: Timestamp of when resource (host or volume) was ready for use - Freed: - type: string - format: date-time - description: Timestamp of when resource (machine or storage) was freed - UsageStart: - type: string - format: date-time - description: The start of the usage reporting window or when the resource was allocated - UsageEnd: - type: string - format: date-time - description: The end of the usage reporting window or when the resource was freed - UsageHours: - type: integer - format: int64 - description: >- - The difference between the UsageEnd and UsageStart rounded up to the - UsageHours - Error: - type: string - description: Description of error that affected the usage reporting diff --git a/v1/api/swagger/components/schemas/UsageReport.yaml b/v1/api/swagger/components/schemas/UsageReport.yaml deleted file mode 100644 index 7fd5acc1..00000000 --- a/v1/api/swagger/components/schemas/UsageReport.yaml +++ /dev/null @@ -1,16 +0,0 @@ -type: object -description: The composite usage report -required: - - Hosts - - Volumes -properties: - Hosts: - description: list of Host usage entries for the report window - type: array - items: - $ref: ./HostUsageEntry.yaml - Volumes: - description: list of Volume usage entries for the report window - type: array - items: - $ref: ./VolumeUsageEntry.yaml diff --git a/v1/api/swagger/components/schemas/VolumeUsageEntry.yaml b/v1/api/swagger/components/schemas/VolumeUsageEntry.yaml deleted file mode 100644 index 63bd40ef..00000000 --- a/v1/api/swagger/components/schemas/VolumeUsageEntry.yaml +++ /dev/null @@ -1,28 +0,0 @@ -allOf: - - $ref: ./UsageEntryBase.yaml - - type: object - required: - - VolumeName - - VolumeID - - FlavorName - - FlavorID - - Capacity - properties: - VolumeName: - type: string - description: Name of the volume - VolumeID: - type: string - format: uuid - description: Unique ID of the volume - FlavorName: - type: string - description: Name of the volume flavor used when creating the volume - FlavorID: - type: string - format: uuid - description: Unique ID of the volume flavor used when creating the volume - Capacity: - type: integer - format: int64 - description: The size of the volume in MB diff --git a/v1/api/swagger/paths/usage-reports.yaml b/v1/api/swagger/paths/usage-reports.yaml deleted file mode 100644 index c1d01e26..00000000 --- a/v1/api/swagger/paths/usage-reports.yaml +++ /dev/null @@ -1,36 +0,0 @@ -get: - tags: - - usage-reports - summary: Get a usage report - description: > - Creates and returns a usage report based on the parameters passed in the - request body - operationId: UsageReport_get - parameters: - - in: query - name: start - required: true - schema: - type: string - description: Start of the billing period - - in: query - name: end - required: false - schema: - type: string - description: End of the billing period, default to now if omitted - responses: - '200': - description: success - content: - application/json: - schema: - $ref: ../components/schemas/UsageReport.yaml - '400': - $ref: ../components/responses/InvalidContent.yaml - '401': - $ref: ../components/responses/Unauthorized.yaml - '405': - $ref: ../components/responses/InvalidInput.yaml - '500': - $ref: ../components/responses/InternalError.yaml diff --git a/v1/api/swagger/swagger.yaml b/v1/api/swagger/swagger.yaml index 86f1e11a..368f4f4d 100644 --- a/v1/api/swagger/swagger.yaml +++ b/v1/api/swagger/swagger.yaml @@ -75,10 +75,6 @@ tags: create volume calls. This provides a detailed information about the OS imaging options, the machine size (a.k.a. Compute Instance Type) options, the storage volume options, data center locations, and such that are needed when creating hosts and volumes. - - name: usage-reports - description: > - Operations related to retrieving information about resource usage within - the project. - name: projects-info description: | Operations related to listing information related to projects. @@ -143,8 +139,6 @@ paths: $ref: paths/networks.yaml /networks/{networkId}: $ref: paths/networks@{networkId}.yaml - /usage-reports: - $ref: paths/usage-reports.yaml /ippools: $ref: paths/ippools.yaml /ippools/{ippoolId}: diff --git a/v1/pkg/client/README.md b/v1/pkg/client/README.md index 0b85065b..eba3ba58 100644 --- a/v1/pkg/client/README.md +++ b/v1/pkg/client/README.md @@ -79,7 +79,6 @@ Class | Method | HTTP request | Description *SshkeysApi* | [**GetByID**](docs/SshkeysApi.md#getbyid) | **Get** /sshkeys/{sshkeyId} | Retrieve SSH Key by ID *SshkeysApi* | [**List**](docs/SshkeysApi.md#list) | **Get** /sshkeys | List all sshkeys in project *SshkeysApi* | [**Update**](docs/SshkeysApi.md#update) | **Put** /sshkeys/{sshkeyId} | Update an existing SSH Key. Only 'Name' or 'Key' fields can be changed. -*UsageReportsApi* | [**Get**](docs/UsageReportsApi.md#get) | **Get** /usage-reports | Get a usage report *VersionApi* | [**Get**](docs/VersionApi.md#get) | **Get** /version | Get api server build version *VolumeAttachmentsApi* | [**Add**](docs/VolumeAttachmentsApi.md#add) | **Post** /volume-attachments | Create a new VolumeAttachment *VolumeAttachmentsApi* | [**Delete**](docs/VolumeAttachmentsApi.md#delete) | **Delete** /volume-attachments/{attachmentId} | Delete a VolumeAttachment @@ -124,8 +123,6 @@ Class | Method | HTTP request | Description - [HostServerPort](docs/HostServerPort.md) - [HostState](docs/HostState.md) - [HostSubstate](docs/HostSubstate.md) - - [HostUsageEntry](docs/HostUsageEntry.md) - - [HostUsageEntryAllOf](docs/HostUsageEntryAllOf.md) - [IpAllocation](docs/IpAllocation.md) - [IpPool](docs/IpPool.md) - [IpPoolAllOf](docs/IpPoolAllOf.md) @@ -201,8 +198,6 @@ Class | Method | HTTP request | Description - [UpdateSshKey](docs/UpdateSshKey.md) - [UpdateVolume](docs/UpdateVolume.md) - [UpdateVolumeAllOf](docs/UpdateVolumeAllOf.md) - - [UsageEntryBase](docs/UsageEntryBase.md) - - [UsageReport](docs/UsageReport.md) - [UseRecord](docs/UseRecord.md) - [UserDefinedSteps](docs/UserDefinedSteps.md) - [UserOp](docs/UserOp.md) @@ -222,8 +217,6 @@ Class | Method | HTTP request | Description - [VolumeState](docs/VolumeState.md) - [VolumeStatus](docs/VolumeStatus.md) - [VolumeSubState](docs/VolumeSubState.md) - - [VolumeUsageEntry](docs/VolumeUsageEntry.md) - - [VolumeUsageEntryAllOf](docs/VolumeUsageEntryAllOf.md) ## Documentation For Authorization diff --git a/v1/pkg/client/api/openapi.yaml b/v1/pkg/client/api/openapi.yaml index 280505bd..1f002280 100644 --- a/v1/pkg/client/api/openapi.yaml +++ b/v1/pkg/client/api/openapi.yaml @@ -57,9 +57,6 @@ tags: - description: | Operations related to listing information that is needed to construct create host and create volume calls. This provides a detailed information about the OS imaging options, the machine size (a.k.a. Compute Instance Type) options, the storage volume options, data center locations, and such that are needed when creating hosts and volumes. name: available-resources -- description: | - Operations related to retrieving information about resource usage within the project. - name: usage-reports - description: | Operations related to listing information related to projects. name: projects-info @@ -2034,58 +2031,6 @@ paths: tags: - networks summary: Operations on a single network - /usage-reports: - get: - description: | - Creates and returns a usage report based on the parameters passed in the request body - operationId: UsageReport_get - parameters: - - description: Start of the billing period - in: query - name: start - required: true - schema: - type: string - - description: End of the billing period, default to now if omitted - in: query - name: end - required: false - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UsageReport' - description: success - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - description: invalid content - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - description: unauthorized - "405": - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - description: invalid input - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - description: internal error - summary: Get a usage report - tags: - - usage-reports /ippools: get: description: Returns an array of all ip pool objects defined within the project. @@ -3506,30 +3451,6 @@ components: allOf: - $ref: '#/components/schemas/UpdateResourceBase' - $ref: '#/components/schemas/UpdateNetwork_allOf' - UsageReport: - description: The composite usage report - example: - Hosts: - - null - - null - Volumes: - - null - - null - properties: - Hosts: - description: list of Host usage entries for the report window - items: - $ref: '#/components/schemas/HostUsageEntry' - type: array - Volumes: - description: list of Volume usage entries for the report window - items: - $ref: '#/components/schemas/VolumeUsageEntry' - type: array - required: - - Hosts - - Volumes - type: object IPPool: allOf: - $ref: '#/components/schemas/ResourceBase' @@ -4970,14 +4891,6 @@ components: - IPVersion - Netmask type: object - HostUsageEntry: - allOf: - - $ref: '#/components/schemas/UsageEntryBase' - - $ref: '#/components/schemas/HostUsageEntry_allOf' - VolumeUsageEntry: - allOf: - - $ref: '#/components/schemas/UsageEntryBase' - - $ref: '#/components/schemas/VolumeUsageEntry_allOf' IPVer: description: | Describes the IP version @@ -5786,60 +5699,6 @@ components: - HostIPAddress - InitiatorName type: object - UsageEntryBase: - properties: - ProjectID: - description: Project ID that contained the host - format: uuid - type: string - LocationID: - description: The location ID is the data center location of the resource. The - LocationID must be one of those provided by the LocationInfo array returned - as part of the get /available-resources call. The locations are typically - described by country, region, and data center. - format: uuid - type: string - Allocated: - description: Timestamp of when resource (machine or storage) was allocated - format: date-time - type: string - Ready: - description: Timestamp of when resource (host or volume) was ready for use - format: date-time - type: string - Freed: - description: Timestamp of when resource (machine or storage) was freed - format: date-time - type: string - UsageStart: - description: The start of the usage reporting window or when the resource - was allocated - format: date-time - type: string - UsageEnd: - description: The end of the usage reporting window or when the resource - was freed - format: date-time - type: string - UsageHours: - description: The difference between the UsageEnd and UsageStart rounded - up to the UsageHours - format: int64 - type: integer - Error: - description: Description of error that affected the usage reporting - type: string - required: - - Allocated - - Error - - Freed - - LocationID - - ProjectID - - Ready - - UsageEnd - - UsageHours - - UsageStart - type: object IPRange: properties: Base: @@ -6875,54 +6734,6 @@ components: - Timeout - UserDefinedSteps - Version - HostUsageEntry_allOf: - properties: - MachineSizeName: - description: Name of the MachineSize requested when host was created - example: HPE-Large - type: string - MachineSizeID: - description: Unique ID of the MachineSize requested when host was created - format: uuid - type: string - HostName: - description: Name of the associated Host - type: string - HostID: - description: Unique ID of the associated Host - format: uuid - type: string - required: - - HostID - - HostName - - MachineSizeID - - MachineSizeName - VolumeUsageEntry_allOf: - properties: - VolumeName: - description: Name of the volume - type: string - VolumeID: - description: Unique ID of the volume - format: uuid - type: string - FlavorName: - description: Name of the volume flavor used when creating the volume - type: string - FlavorID: - description: Unique ID of the volume flavor used when creating the volume - format: uuid - type: string - Capacity: - description: The size of the volume in MB - format: int64 - type: integer - required: - - Capacity - - FlavorID - - FlavorName - - VolumeID - - VolumeName securitySchemes: BearerAuth: bearerFormat: JWT diff --git a/v1/pkg/client/api_usage_reports.go b/v1/pkg/client/api_usage_reports.go deleted file mode 100644 index 980fe21f..00000000 --- a/v1/pkg/client/api_usage_reports.go +++ /dev/null @@ -1,188 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "github.com/antihax/optional" -) - -// Linger please -var ( - _ _context.Context -) - -// UsageReportsApiService UsageReportsApi service -type UsageReportsApiService service - -// UsageReportsApiGetOpts Optional parameters for the method 'Get' -type UsageReportsApiGetOpts struct { - End optional.String -} - -/* -Get Get a usage report -Creates and returns a usage report based on the parameters passed in the request body - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param start Start of the billing period - * @param optional nil or *UsageReportsApiGetOpts - Optional Parameters: - * @param "End" (optional.String) - End of the billing period, default to now if omitted -@return UsageReport -*/ -func (a *UsageReportsApiService) Get(ctx _context.Context, start string, localVarOptionals *UsageReportsApiGetOpts) (UsageReport, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue UsageReport - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usage-reports" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("start", parameterToString(start, "")) - if localVarOptionals != nil && localVarOptionals.End.IsSet() { - localVarQueryParams.Add("end", parameterToString(localVarOptionals.End.Value(), "")) - } - // 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 - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["Membership"] = key - } - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["Project"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 200 { - var v UsageReport - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/v1/pkg/client/client.go b/v1/pkg/client/client.go index e409bdca..1063f24e 100644 --- a/v1/pkg/client/client.go +++ b/v1/pkg/client/client.go @@ -67,8 +67,6 @@ type APIClient struct { SshkeysApi SshkeysAPI - UsageReportsApi UsageReportsAPI - VersionApi VersionAPI VolumeAttachmentsApi VolumeAttachmentsAPI @@ -101,7 +99,6 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.ProjectsInfoApi = (*ProjectsInfoApiService)(&c.common) c.ServicesApi = (*ServicesApiService)(&c.common) c.SshkeysApi = (*SshkeysApiService)(&c.common) - c.UsageReportsApi = (*UsageReportsApiService)(&c.common) c.VersionApi = (*VersionApiService)(&c.common) c.VolumeAttachmentsApi = (*VolumeAttachmentsApiService)(&c.common) c.VolumesApi = (*VolumesApiService)(&c.common) diff --git a/v1/pkg/client/docs/HostUsageEntry.md b/v1/pkg/client/docs/HostUsageEntry.md deleted file mode 100644 index 2700b292..00000000 --- a/v1/pkg/client/docs/HostUsageEntry.md +++ /dev/null @@ -1,23 +0,0 @@ -# HostUsageEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ProjectID** | **string** | Project ID that contained the host | -**LocationID** | **string** | The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center. | -**Allocated** | [**time.Time**](time.Time.md) | Timestamp of when resource (machine or storage) was allocated | -**Ready** | [**time.Time**](time.Time.md) | Timestamp of when resource (host or volume) was ready for use | -**Freed** | [**time.Time**](time.Time.md) | Timestamp of when resource (machine or storage) was freed | -**UsageStart** | [**time.Time**](time.Time.md) | The start of the usage reporting window or when the resource was allocated | -**UsageEnd** | [**time.Time**](time.Time.md) | The end of the usage reporting window or when the resource was freed | -**UsageHours** | **int64** | The difference between the UsageEnd and UsageStart rounded up to the UsageHours | -**Error** | **string** | Description of error that affected the usage reporting | -**MachineSizeName** | **string** | Name of the MachineSize requested when host was created | -**MachineSizeID** | **string** | Unique ID of the MachineSize requested when host was created | -**HostName** | **string** | Name of the associated Host | -**HostID** | **string** | Unique ID of the associated Host | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/pkg/client/docs/HostUsageEntryAllOf.md b/v1/pkg/client/docs/HostUsageEntryAllOf.md deleted file mode 100644 index 5dcbdd11..00000000 --- a/v1/pkg/client/docs/HostUsageEntryAllOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# HostUsageEntryAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MachineSizeName** | **string** | Name of the MachineSize requested when host was created | -**MachineSizeID** | **string** | Unique ID of the MachineSize requested when host was created | -**HostName** | **string** | Name of the associated Host | -**HostID** | **string** | Unique ID of the associated Host | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/pkg/client/docs/UsageEntryBase.md b/v1/pkg/client/docs/UsageEntryBase.md deleted file mode 100644 index ae6eadbd..00000000 --- a/v1/pkg/client/docs/UsageEntryBase.md +++ /dev/null @@ -1,19 +0,0 @@ -# UsageEntryBase - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ProjectID** | **string** | Project ID that contained the host | -**LocationID** | **string** | The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center. | -**Allocated** | [**time.Time**](time.Time.md) | Timestamp of when resource (machine or storage) was allocated | -**Ready** | [**time.Time**](time.Time.md) | Timestamp of when resource (host or volume) was ready for use | -**Freed** | [**time.Time**](time.Time.md) | Timestamp of when resource (machine or storage) was freed | -**UsageStart** | [**time.Time**](time.Time.md) | The start of the usage reporting window or when the resource was allocated | -**UsageEnd** | [**time.Time**](time.Time.md) | The end of the usage reporting window or when the resource was freed | -**UsageHours** | **int64** | The difference between the UsageEnd and UsageStart rounded up to the UsageHours | -**Error** | **string** | Description of error that affected the usage reporting | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/pkg/client/docs/UsageReport.md b/v1/pkg/client/docs/UsageReport.md deleted file mode 100644 index 83a54241..00000000 --- a/v1/pkg/client/docs/UsageReport.md +++ /dev/null @@ -1,12 +0,0 @@ -# UsageReport - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Hosts** | [**[]HostUsageEntry**](HostUsageEntry.md) | list of Host usage entries for the report window | -**Volumes** | [**[]VolumeUsageEntry**](VolumeUsageEntry.md) | list of Volume usage entries for the report window | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/pkg/client/docs/UsageReportsApi.md b/v1/pkg/client/docs/UsageReportsApi.md deleted file mode 100644 index d1bb64ca..00000000 --- a/v1/pkg/client/docs/UsageReportsApi.md +++ /dev/null @@ -1,54 +0,0 @@ -# \UsageReportsApi - -All URIs are relative to *https://client.greenlake.hpe.com/api/metal/rest/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**Get**](UsageReportsApi.md#Get) | **Get** /usage-reports | Get a usage report - - - -## Get - -> UsageReport Get(ctx, start, optional) - -Get a usage report - -Creates and returns a usage report based on the parameters passed in the request body - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**start** | **string**| Start of the billing period | - **optional** | ***GetOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a GetOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **end** | **optional.String**| End of the billing period, default to now if omitted | - -### Return type - -[**UsageReport**](UsageReport.md) - -### Authorization - -[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership), [Project](../README.md#Project) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/v1/pkg/client/docs/VolumeUsageEntry.md b/v1/pkg/client/docs/VolumeUsageEntry.md deleted file mode 100644 index be7ab57b..00000000 --- a/v1/pkg/client/docs/VolumeUsageEntry.md +++ /dev/null @@ -1,24 +0,0 @@ -# VolumeUsageEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ProjectID** | **string** | Project ID that contained the host | -**LocationID** | **string** | The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center. | -**Allocated** | [**time.Time**](time.Time.md) | Timestamp of when resource (machine or storage) was allocated | -**Ready** | [**time.Time**](time.Time.md) | Timestamp of when resource (host or volume) was ready for use | -**Freed** | [**time.Time**](time.Time.md) | Timestamp of when resource (machine or storage) was freed | -**UsageStart** | [**time.Time**](time.Time.md) | The start of the usage reporting window or when the resource was allocated | -**UsageEnd** | [**time.Time**](time.Time.md) | The end of the usage reporting window or when the resource was freed | -**UsageHours** | **int64** | The difference between the UsageEnd and UsageStart rounded up to the UsageHours | -**Error** | **string** | Description of error that affected the usage reporting | -**VolumeName** | **string** | Name of the volume | -**VolumeID** | **string** | Unique ID of the volume | -**FlavorName** | **string** | Name of the volume flavor used when creating the volume | -**FlavorID** | **string** | Unique ID of the volume flavor used when creating the volume | -**Capacity** | **int64** | The size of the volume in MB | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/pkg/client/docs/VolumeUsageEntryAllOf.md b/v1/pkg/client/docs/VolumeUsageEntryAllOf.md deleted file mode 100644 index b03eee28..00000000 --- a/v1/pkg/client/docs/VolumeUsageEntryAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# VolumeUsageEntryAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VolumeName** | **string** | Name of the volume | -**VolumeID** | **string** | Unique ID of the volume | -**FlavorName** | **string** | Name of the volume flavor used when creating the volume | -**FlavorID** | **string** | Unique ID of the volume flavor used when creating the volume | -**Capacity** | **int64** | The size of the volume in MB | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/pkg/client/interface_usage_reports.go b/v1/pkg/client/interface_usage_reports.go deleted file mode 100644 index 0fc6be27..00000000 --- a/v1/pkg/client/interface_usage_reports.go +++ /dev/null @@ -1,25 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -// Code generated by ifacemaker; DO NOT EDIT. - -package client - -import ( - _context "context" - _nethttp "net/http" -) - -// UsageReportsAPI defines the client functions provided for UsageReports. -type UsageReportsAPI interface { - /* - Get Get a usage report - Creates and returns a usage report based on the parameters passed in the request body - - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param start Start of the billing period - - @param optional nil or *UsageReportsApiGetOpts - Optional Parameters: - - @param "End" (optional.String) - End of the billing period, default to now if omitted - - @return UsageReport - */ - Get(ctx _context.Context, start string, localVarOptionals *UsageReportsApiGetOpts) (UsageReport, *_nethttp.Response, error) -} diff --git a/v1/pkg/client/model_host_usage_entry.go b/v1/pkg/client/model_host_usage_entry.go deleted file mode 100644 index 67b568f6..00000000 --- a/v1/pkg/client/model_host_usage_entry.go +++ /dev/null @@ -1,44 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client -import ( - "time" -) -// HostUsageEntry struct for HostUsageEntry -type HostUsageEntry struct { - // Project ID that contained the host - ProjectID string `json:"ProjectID"` - // The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center. - LocationID string `json:"LocationID"` - // Timestamp of when resource (machine or storage) was allocated - Allocated time.Time `json:"Allocated"` - // Timestamp of when resource (host or volume) was ready for use - Ready time.Time `json:"Ready"` - // Timestamp of when resource (machine or storage) was freed - Freed time.Time `json:"Freed"` - // The start of the usage reporting window or when the resource was allocated - UsageStart time.Time `json:"UsageStart"` - // The end of the usage reporting window or when the resource was freed - UsageEnd time.Time `json:"UsageEnd"` - // The difference between the UsageEnd and UsageStart rounded up to the UsageHours - UsageHours int64 `json:"UsageHours"` - // Description of error that affected the usage reporting - Error string `json:"Error"` - // Name of the MachineSize requested when host was created - MachineSizeName string `json:"MachineSizeName"` - // Unique ID of the MachineSize requested when host was created - MachineSizeID string `json:"MachineSizeID"` - // Name of the associated Host - HostName string `json:"HostName"` - // Unique ID of the associated Host - HostID string `json:"HostID"` -} diff --git a/v1/pkg/client/model_host_usage_entry_all_of.go b/v1/pkg/client/model_host_usage_entry_all_of.go deleted file mode 100644 index 05285601..00000000 --- a/v1/pkg/client/model_host_usage_entry_all_of.go +++ /dev/null @@ -1,23 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client -// HostUsageEntryAllOf struct for HostUsageEntryAllOf -type HostUsageEntryAllOf struct { - // Name of the MachineSize requested when host was created - MachineSizeName string `json:"MachineSizeName"` - // Unique ID of the MachineSize requested when host was created - MachineSizeID string `json:"MachineSizeID"` - // Name of the associated Host - HostName string `json:"HostName"` - // Unique ID of the associated Host - HostID string `json:"HostID"` -} diff --git a/v1/pkg/client/model_usage_entry_base.go b/v1/pkg/client/model_usage_entry_base.go deleted file mode 100644 index 8405728c..00000000 --- a/v1/pkg/client/model_usage_entry_base.go +++ /dev/null @@ -1,36 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client -import ( - "time" -) -// UsageEntryBase struct for UsageEntryBase -type UsageEntryBase struct { - // Project ID that contained the host - ProjectID string `json:"ProjectID"` - // The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center. - LocationID string `json:"LocationID"` - // Timestamp of when resource (machine or storage) was allocated - Allocated time.Time `json:"Allocated"` - // Timestamp of when resource (host or volume) was ready for use - Ready time.Time `json:"Ready"` - // Timestamp of when resource (machine or storage) was freed - Freed time.Time `json:"Freed"` - // The start of the usage reporting window or when the resource was allocated - UsageStart time.Time `json:"UsageStart"` - // The end of the usage reporting window or when the resource was freed - UsageEnd time.Time `json:"UsageEnd"` - // The difference between the UsageEnd and UsageStart rounded up to the UsageHours - UsageHours int64 `json:"UsageHours"` - // Description of error that affected the usage reporting - Error string `json:"Error"` -} diff --git a/v1/pkg/client/model_usage_report.go b/v1/pkg/client/model_usage_report.go deleted file mode 100644 index 31bc2619..00000000 --- a/v1/pkg/client/model_usage_report.go +++ /dev/null @@ -1,19 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client -// UsageReport The composite usage report -type UsageReport struct { - // list of Host usage entries for the report window - Hosts []HostUsageEntry `json:"Hosts"` - // list of Volume usage entries for the report window - Volumes []VolumeUsageEntry `json:"Volumes"` -} diff --git a/v1/pkg/client/model_volume_usage_entry.go b/v1/pkg/client/model_volume_usage_entry.go deleted file mode 100644 index 91059b5b..00000000 --- a/v1/pkg/client/model_volume_usage_entry.go +++ /dev/null @@ -1,46 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client -import ( - "time" -) -// VolumeUsageEntry struct for VolumeUsageEntry -type VolumeUsageEntry struct { - // Project ID that contained the host - ProjectID string `json:"ProjectID"` - // The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center. - LocationID string `json:"LocationID"` - // Timestamp of when resource (machine or storage) was allocated - Allocated time.Time `json:"Allocated"` - // Timestamp of when resource (host or volume) was ready for use - Ready time.Time `json:"Ready"` - // Timestamp of when resource (machine or storage) was freed - Freed time.Time `json:"Freed"` - // The start of the usage reporting window or when the resource was allocated - UsageStart time.Time `json:"UsageStart"` - // The end of the usage reporting window or when the resource was freed - UsageEnd time.Time `json:"UsageEnd"` - // The difference between the UsageEnd and UsageStart rounded up to the UsageHours - UsageHours int64 `json:"UsageHours"` - // Description of error that affected the usage reporting - Error string `json:"Error"` - // Name of the volume - VolumeName string `json:"VolumeName"` - // Unique ID of the volume - VolumeID string `json:"VolumeID"` - // Name of the volume flavor used when creating the volume - FlavorName string `json:"FlavorName"` - // Unique ID of the volume flavor used when creating the volume - FlavorID string `json:"FlavorID"` - // The size of the volume in MB - Capacity int64 `json:"Capacity"` -} diff --git a/v1/pkg/client/model_volume_usage_entry_all_of.go b/v1/pkg/client/model_volume_usage_entry_all_of.go deleted file mode 100644 index e81ee4ba..00000000 --- a/v1/pkg/client/model_volume_usage_entry_all_of.go +++ /dev/null @@ -1,25 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -/* - * HPE GreenLake for bare metal API - * - * This Metal Client REST API provides access to bare metal as-a-service (BMaaS) within a single project context. Clients are able to create fully-provisioned hosts, storage volumes, and project-specific private networks in an isolated project environment. Project-owned resources that can be accessed via this API include - Host, Volume, VolumeAttachment, Network (project private), and SSH Key. Each API call is done within a single project context. The specific Project identifier must be provided within the header of for each REST call. The server will validate that the provided authentication credentials (JWTs) are valid for the referenced project before any operation is performed. If a single credential is valid for multiple projects, the client must still reference a single project in the header for each API call. Clients can also access information about available services and resources through the AvailableResources object. This object provides detailed information about the OS imaging options, the machine size options, the storage volume options, and data center locations which are needed when creating hosts and volumes. - * - * API version: v1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package client -// VolumeUsageEntryAllOf struct for VolumeUsageEntryAllOf -type VolumeUsageEntryAllOf struct { - // Name of the volume - VolumeName string `json:"VolumeName"` - // Unique ID of the volume - VolumeID string `json:"VolumeID"` - // Name of the volume flavor used when creating the volume - FlavorName string `json:"FlavorName"` - // Unique ID of the volume flavor used when creating the volume - FlavorID string `json:"FlavorID"` - // The size of the volume in MB - Capacity int64 `json:"Capacity"` -} diff --git a/v1/pkg/mockquakeclient/mock_usage_reports.go b/v1/pkg/mockquakeclient/mock_usage_reports.go deleted file mode 100644 index 256108e0..00000000 --- a/v1/pkg/mockquakeclient/mock_usage_reports.go +++ /dev/null @@ -1,55 +0,0 @@ -// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP - -// Code generated by MockGen. DO NOT EDIT. -// Source: interface_usage_reports.go - -// Package mockquakeclient is a generated GoMock package. -package mockquakeclient - -import ( - context "context" - http "net/http" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - client "github.com/hewlettpackard/hpegl-metal-client/v1/pkg/client" -) - -// MockUsageReportsAPI is a mock of UsageReportsAPI interface. -type MockUsageReportsAPI struct { - ctrl *gomock.Controller - recorder *MockUsageReportsAPIMockRecorder -} - -// MockUsageReportsAPIMockRecorder is the mock recorder for MockUsageReportsAPI. -type MockUsageReportsAPIMockRecorder struct { - mock *MockUsageReportsAPI -} - -// NewMockUsageReportsAPI creates a new mock instance. -func NewMockUsageReportsAPI(ctrl *gomock.Controller) *MockUsageReportsAPI { - mock := &MockUsageReportsAPI{ctrl: ctrl} - mock.recorder = &MockUsageReportsAPIMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockUsageReportsAPI) EXPECT() *MockUsageReportsAPIMockRecorder { - return m.recorder -} - -// Get mocks base method. -func (m *MockUsageReportsAPI) Get(ctx context.Context, start string, localVarOptionals *client.UsageReportsApiGetOpts) (client.UsageReport, *http.Response, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, start, localVarOptionals) - ret0, _ := ret[0].(client.UsageReport) - ret1, _ := ret[1].(*http.Response) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// Get indicates an expected call of Get. -func (mr *MockUsageReportsAPIMockRecorder) Get(ctx, start, localVarOptionals interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUsageReportsAPI)(nil).Get), ctx, start, localVarOptionals) -}