diff --git a/API.md b/API.md index 22a55342..90533a68 100644 --- a/API.md +++ b/API.md @@ -181,6 +181,7 @@ Class | Method | HTTP request | Description *CapacityApi* | [**FindCapacityForMetro**](docs/CapacityApi.md#findcapacityformetro) | **Get** /capacity/metros | View capacity for metros *CapacityApi* | [**FindOrganizationCapacityPerFacility**](docs/CapacityApi.md#findorganizationcapacityperfacility) | **Get** /organizations/{id}/capacity | View available hardware plans per Facility for given organization *CapacityApi* | [**FindOrganizationCapacityPerMetro**](docs/CapacityApi.md#findorganizationcapacitypermetro) | **Get** /organizations/{id}/capacity/metros | View available hardware plans per Metro for given organization +*ConsoleLogDetailsApi* | [**CaptureScreenshot**](docs/ConsoleLogDetailsApi.md#capturescreenshot) | **Get** /devices/{id}/diagnostics/screenshot | *DevicesApi* | [**CreateBgpSession**](docs/DevicesApi.md#createbgpsession) | **Post** /devices/{id}/bgp/sessions | Create a BGP session *DevicesApi* | [**CreateDevice**](docs/DevicesApi.md#createdevice) | **Post** /projects/{id}/devices | Create a device *DevicesApi* | [**CreateIPAssignment**](docs/DevicesApi.md#createipassignment) | **Post** /devices/{id}/ips | Create an ip assignment diff --git a/api/openapi.yaml b/api/openapi.yaml index 29913118..974cfce6 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -181,6 +181,9 @@ tags: - description: | Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. name: Firmware Sets +- description: | + Console Log Details. Notice: This is a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Console Log Details - description: | Global BGP Range Management externalDocs: @@ -1903,6 +1906,46 @@ paths: summary: Retrieve the custom metadata of an instance tags: - Devices + /devices/{id}/diagnostics/screenshot: + get: + description: "Capture a screenshot from the device, if supported, via the BMC." + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/jpeg: + schema: + format: binary + type: string + description: An image file + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not implemented for device + tags: + - Console Log Details /devices/{id}/diagnostics/health/rollup: get: description: Returns the health rollup status of the device. @@ -7660,6 +7703,11 @@ paths: name: facility schema: type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string - description: Filter by partial hostname in: query name: hostname @@ -8795,6 +8843,7 @@ paths: - SSHKeys /projects/{id}/transfers: post: + deprecated: true description: Organization owners can transfer their projects to other organizations. operationId: createTransferRequest parameters: @@ -29635,9 +29684,10 @@ components: type: string type: array local_asn: - description: The new `local_asn` value for the VRF. This field cannot be - updated when there are active Interconnection Virtual Circuits associated - to the VRF. + description: "The new `local_asn` value for the VRF. This field cannot be\ + \ updated when there are active Interconnection Virtual Circuits associated\ + \ to the VRF, or if any of the VLANs of the VRF's metal gateway has been\ + \ assigned on an instance." format: int32 type: integer name: diff --git a/docs/ConsoleLogDetailsApi.md b/docs/ConsoleLogDetailsApi.md new file mode 100644 index 00000000..42a84e2e --- /dev/null +++ b/docs/ConsoleLogDetailsApi.md @@ -0,0 +1,79 @@ +# \ConsoleLogDetailsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CaptureScreenshot**](ConsoleLogDetailsApi.md#CaptureScreenshot) | **Get** /devices/{id}/diagnostics/screenshot | + + + +## CaptureScreenshot + +> *os.File CaptureScreenshot(ctx, id).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix-labs/metal-go/metal/v1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConsoleLogDetailsApi.CaptureScreenshot(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConsoleLogDetailsApi.CaptureScreenshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CaptureScreenshot`: *os.File + fmt.Fprintf(os.Stdout, "Response from `ConsoleLogDetailsApi.CaptureScreenshot`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCaptureScreenshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/jpeg, 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/docs/DevicesApi.md b/docs/DevicesApi.md index e8b09d7d..c7911c84 100644 --- a/docs/DevicesApi.md +++ b/docs/DevicesApi.md @@ -991,7 +991,7 @@ Name | Type | Description | Notes ## FindProjectDevices -> DeviceList FindProjectDevices(ctx, id).Search(search).Categories(categories).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() +> DeviceList FindProjectDevices(ctx, id).Search(search).Categories(categories).Facility(facility).Metro(metro).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() Retrieve all devices of a project @@ -1015,6 +1015,7 @@ func main() { search := "search_example" // string | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. (optional) categories := []openapiclient.FindOrganizationDevicesCategoriesParameterInner{openapiclient.findOrganizationDevices_categories_parameter_inner("compute")} // []FindOrganizationDevicesCategoriesParameterInner | Filter by plan category (optional) facility := "facility_example" // string | Filter by device facility (optional) + metro := "metro_example" // string | Filter by device metro (optional) hostname := "hostname_example" // string | Filter by partial hostname (optional) reserved := true // bool | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. (optional) tag := "tag_example" // string | Filter by device tag (optional) @@ -1027,7 +1028,7 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DevicesApi.FindProjectDevices(context.Background(), id).Search(search).Categories(categories).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + resp, r, err := apiClient.DevicesApi.FindProjectDevices(context.Background(), id).Search(search).Categories(categories).Facility(facility).Metro(metro).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindProjectDevices``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1056,6 +1057,7 @@ Name | Type | Description | Notes **search** | **string** | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. | **categories** | [**[]FindOrganizationDevicesCategoriesParameterInner**](FindOrganizationDevicesCategoriesParameterInner.md) | Filter by plan category | **facility** | **string** | Filter by device facility | + **metro** | **string** | Filter by device metro | **hostname** | **string** | Filter by partial hostname | **reserved** | **bool** | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. | **tag** | **string** | Filter by device tag | diff --git a/docs/VrfUpdateInput.md b/docs/VrfUpdateInput.md index f3c84eae..810c07cb 100644 --- a/docs/VrfUpdateInput.md +++ b/docs/VrfUpdateInput.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **BgpDynamicNeighborsBfdEnabled** | Pointer to **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] **Description** | Pointer to **string** | | [optional] **IpRanges** | Pointer to **[]string** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF. | [optional] -**LocalAsn** | Pointer to **int32** | The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF. | [optional] +**LocalAsn** | Pointer to **int32** | The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. | [optional] **Name** | Pointer to **string** | | [optional] **Tags** | Pointer to **[]string** | | [optional] diff --git a/metal/v1/.openapi-generator/FILES b/metal/v1/.openapi-generator/FILES index 7a69e690..0bf97e6f 100644 --- a/metal/v1/.openapi-generator/FILES +++ b/metal/v1/.openapi-generator/FILES @@ -7,6 +7,7 @@ api_authentication.go api_batches.go api_bgp.go api_capacity.go +api_console_log_details.go api_devices.go api_emails.go api_events.go @@ -86,6 +87,7 @@ docs/CapacityInput.md docs/CapacityLevelPerBaremetal.md docs/CapacityList.md docs/Component.md +docs/ConsoleLogDetailsApi.md docs/Coordinates.md docs/CreateDeviceRequest.md docs/CreateEmailInput.md @@ -685,6 +687,7 @@ test/api_authentication_test.go test/api_batches_test.go test/api_bgp_test.go test/api_capacity_test.go +test/api_console_log_details_test.go test/api_devices_test.go test/api_emails_test.go test/api_events_test.go diff --git a/metal/v1/api_console_log_details.go b/metal/v1/api_console_log_details.go new file mode 100644 index 00000000..72a684bc --- /dev/null +++ b/metal/v1/api_console_log_details.go @@ -0,0 +1,175 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" +) + +// ConsoleLogDetailsApiService ConsoleLogDetailsApi service +type ConsoleLogDetailsApiService service + +type ApiCaptureScreenshotRequest struct { + ctx context.Context + ApiService *ConsoleLogDetailsApiService + id string +} + +func (r ApiCaptureScreenshotRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.CaptureScreenshotExecute(r) +} + +/* +CaptureScreenshot Method for CaptureScreenshot + +Capture a screenshot from the device, if supported, via the BMC. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiCaptureScreenshotRequest +*/ +func (a *ConsoleLogDetailsApiService) CaptureScreenshot(ctx context.Context, id string) ApiCaptureScreenshotRequest { + return ApiCaptureScreenshotRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *ConsoleLogDetailsApiService) CaptureScreenshotExecute(r ApiCaptureScreenshotRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConsoleLogDetailsApiService.CaptureScreenshot") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/diagnostics/screenshot" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/jpeg", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + 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/metal/v1/api_devices.go b/metal/v1/api_devices.go index 5d075505..c99da91a 100644 --- a/metal/v1/api_devices.go +++ b/metal/v1/api_devices.go @@ -2242,6 +2242,7 @@ type ApiFindProjectDevicesRequest struct { search *string categories *[]FindOrganizationDevicesCategoriesParameterInner facility *string + metro *string hostname *string reserved *bool tag *string @@ -2271,6 +2272,12 @@ func (r ApiFindProjectDevicesRequest) Facility(facility string) ApiFindProjectDe return r } +// Filter by device metro +func (r ApiFindProjectDevicesRequest) Metro(metro string) ApiFindProjectDevicesRequest { + r.metro = &metro + return r +} + // Filter by partial hostname func (r ApiFindProjectDevicesRequest) Hostname(hostname string) ApiFindProjectDevicesRequest { r.hostname = &hostname @@ -2378,6 +2385,9 @@ func (a *DevicesApiService) FindProjectDevicesExecute(r ApiFindProjectDevicesReq if r.facility != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "facility", r.facility, "") } + if r.metro != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "metro", r.metro, "") + } if r.hostname != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "hostname", r.hostname, "") } diff --git a/metal/v1/api_projects.go b/metal/v1/api_projects.go index c3911868..1b952811 100644 --- a/metal/v1/api_projects.go +++ b/metal/v1/api_projects.go @@ -405,6 +405,8 @@ Organization owners can transfer their projects to other organizations. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id UUID of the project to be transferred @return ApiCreateTransferRequestRequest + +Deprecated */ func (a *ProjectsApiService) CreateTransferRequest(ctx context.Context, id string) ApiCreateTransferRequestRequest { return ApiCreateTransferRequestRequest{ @@ -417,6 +419,8 @@ func (a *ProjectsApiService) CreateTransferRequest(ctx context.Context, id strin // Execute executes the request // // @return TransferRequest +// +// Deprecated func (a *ProjectsApiService) CreateTransferRequestExecute(r ApiCreateTransferRequestRequest) (*TransferRequest, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost diff --git a/metal/v1/client.go b/metal/v1/client.go index d4653232..082bc38a 100644 --- a/metal/v1/client.go +++ b/metal/v1/client.go @@ -57,6 +57,8 @@ type APIClient struct { CapacityApi *CapacityApiService + ConsoleLogDetailsApi *ConsoleLogDetailsApiService + DevicesApi *DevicesApiService EmailsApi *EmailsApiService @@ -148,6 +150,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.BGPApi = (*BGPApiService)(&c.common) c.BatchesApi = (*BatchesApiService)(&c.common) c.CapacityApi = (*CapacityApiService)(&c.common) + c.ConsoleLogDetailsApi = (*ConsoleLogDetailsApiService)(&c.common) c.DevicesApi = (*DevicesApiService)(&c.common) c.EmailsApi = (*EmailsApiService)(&c.common) c.EventsApi = (*EventsApiService)(&c.common) diff --git a/metal/v1/model_vrf_update_input.go b/metal/v1/model_vrf_update_input.go index a270d061..26851a8f 100644 --- a/metal/v1/model_vrf_update_input.go +++ b/metal/v1/model_vrf_update_input.go @@ -29,7 +29,7 @@ type VrfUpdateInput struct { Description *string `json:"description,omitempty"` // A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF. IpRanges []string `json:"ip_ranges,omitempty"` - // The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF. + // The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. LocalAsn *int32 `json:"local_asn,omitempty"` Name *string `json:"name,omitempty"` Tags []string `json:"tags,omitempty"` diff --git a/metal/v1/test/api_console_log_details_test.go b/metal/v1/test/api_console_log_details_test.go new file mode 100644 index 00000000..76655baf --- /dev/null +++ b/metal/v1/test/api_console_log_details_test.go @@ -0,0 +1,36 @@ +/* +Metal API + +Testing ConsoleLogDetailsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package v1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix-labs/metal-go/metal/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_v1_ConsoleLogDetailsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ConsoleLogDetailsApiService CaptureScreenshot", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.ConsoleLogDetailsApi.CaptureScreenshot(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/patches/spec.fetched.json/20230908-updated-pro-quantity-in-metro-info.patch b/patches/spec.fetched.json/20230908-updated-pro-quantity-in-metro-info.patch deleted file mode 100644 index 9400d416..00000000 --- a/patches/spec.fetched.json/20230908-updated-pro-quantity-in-metro-info.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/spec/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml b/spec/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml -index de2afda..2fb51ba 100644 ---- a/spec/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml -+++ b/spec/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml -@@ -11,5 +11,5 @@ properties: - type: string - quantity: - description: The number of servers sent to check capacity. -- type: integer -+ type: string - type: object diff --git a/spec/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml b/spec/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml index de2afda2..2fb51ba2 100644 --- a/spec/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml +++ b/spec/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml @@ -11,5 +11,5 @@ properties: type: string quantity: description: The number of servers sent to check capacity. - type: integer + type: string type: object diff --git a/spec/oas3.fetched/components/schemas/VrfUpdateInput.yaml b/spec/oas3.fetched/components/schemas/VrfUpdateInput.yaml index 48c37455..4dd5a4e3 100644 --- a/spec/oas3.fetched/components/schemas/VrfUpdateInput.yaml +++ b/spec/oas3.fetched/components/schemas/VrfUpdateInput.yaml @@ -15,7 +15,7 @@ properties: local_asn: type: integer format: int32 - description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF. + description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. name: type: string tags: diff --git a/spec/oas3.fetched/openapi3.yaml b/spec/oas3.fetched/openapi3.yaml index a7db4149..9822cd39 100644 --- a/spec/oas3.fetched/openapi3.yaml +++ b/spec/oas3.fetched/openapi3.yaml @@ -552,6 +552,8 @@ paths: $ref: ./paths/devices/id/bgp/sessions.yaml /devices/{id}/customdata: $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/screenshot: + $ref: ./paths/devices/id/diagnostics/screenshot.yaml /devices/{id}/diagnostics/health/rollup: $ref: ./paths/devices/id/diagnostics/health/rollup.yaml /devices/{id}/events: @@ -902,6 +904,9 @@ tags: - description: > Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. name: Firmware Sets + - description: > + Console Log Details. Notice: This is a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Console Log Details - description: > Global BGP Range Management name: GlobalBgpRanges diff --git a/spec/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml b/spec/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml new file mode 100644 index 00000000..67c2d147 --- /dev/null +++ b/spec/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml @@ -0,0 +1,39 @@ +get: + description: Capture a screenshot from the device, if supported, via the BMC. + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + tags: + - Console Log Details + responses: + "200": + description: An image file + content: + application/jpeg: + schema: + type: string + format: binary + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "501": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not implemented for device diff --git a/spec/oas3.fetched/paths/projects/id/devices.yaml b/spec/oas3.fetched/paths/projects/id/devices.yaml index c939c980..7877f6cb 100644 --- a/spec/oas3.fetched/paths/projects/id/devices.yaml +++ b/spec/oas3.fetched/paths/projects/id/devices.yaml @@ -26,6 +26,11 @@ get: name: facility schema: type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string - description: Filter by partial hostname in: query name: hostname diff --git a/spec/oas3.fetched/paths/projects/id/transfers.yaml b/spec/oas3.fetched/paths/projects/id/transfers.yaml index f01f055b..cf38cf5b 100644 --- a/spec/oas3.fetched/paths/projects/id/transfers.yaml +++ b/spec/oas3.fetched/paths/projects/id/transfers.yaml @@ -1,4 +1,5 @@ post: + deprecated: true description: Organization owners can transfer their projects to other organizations. operationId: createTransferRequest parameters: diff --git a/spec/oas3.patched/components/schemas/VrfUpdateInput.yaml b/spec/oas3.patched/components/schemas/VrfUpdateInput.yaml index 48c37455..4dd5a4e3 100644 --- a/spec/oas3.patched/components/schemas/VrfUpdateInput.yaml +++ b/spec/oas3.patched/components/schemas/VrfUpdateInput.yaml @@ -15,7 +15,7 @@ properties: local_asn: type: integer format: int32 - description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF. + description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. name: type: string tags: diff --git a/spec/oas3.patched/openapi3.yaml b/spec/oas3.patched/openapi3.yaml index a7db4149..9822cd39 100644 --- a/spec/oas3.patched/openapi3.yaml +++ b/spec/oas3.patched/openapi3.yaml @@ -552,6 +552,8 @@ paths: $ref: ./paths/devices/id/bgp/sessions.yaml /devices/{id}/customdata: $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/screenshot: + $ref: ./paths/devices/id/diagnostics/screenshot.yaml /devices/{id}/diagnostics/health/rollup: $ref: ./paths/devices/id/diagnostics/health/rollup.yaml /devices/{id}/events: @@ -902,6 +904,9 @@ tags: - description: > Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. name: Firmware Sets + - description: > + Console Log Details. Notice: This is a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Console Log Details - description: > Global BGP Range Management name: GlobalBgpRanges diff --git a/spec/oas3.patched/paths/devices/id/diagnostics/screenshot.yaml b/spec/oas3.patched/paths/devices/id/diagnostics/screenshot.yaml new file mode 100644 index 00000000..67c2d147 --- /dev/null +++ b/spec/oas3.patched/paths/devices/id/diagnostics/screenshot.yaml @@ -0,0 +1,39 @@ +get: + description: Capture a screenshot from the device, if supported, via the BMC. + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + tags: + - Console Log Details + responses: + "200": + description: An image file + content: + application/jpeg: + schema: + type: string + format: binary + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "501": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not implemented for device diff --git a/spec/oas3.patched/paths/projects/id/devices.yaml b/spec/oas3.patched/paths/projects/id/devices.yaml index 290006f7..ba3422af 100644 --- a/spec/oas3.patched/paths/projects/id/devices.yaml +++ b/spec/oas3.patched/paths/projects/id/devices.yaml @@ -26,6 +26,11 @@ get: name: facility schema: type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string - description: Filter by partial hostname in: query name: hostname diff --git a/spec/oas3.patched/paths/projects/id/transfers.yaml b/spec/oas3.patched/paths/projects/id/transfers.yaml index f01f055b..cf38cf5b 100644 --- a/spec/oas3.patched/paths/projects/id/transfers.yaml +++ b/spec/oas3.patched/paths/projects/id/transfers.yaml @@ -1,4 +1,5 @@ post: + deprecated: true description: Organization owners can transfer their projects to other organizations. operationId: createTransferRequest parameters: