go-redfish/client
James Gu 470a7752c6 Add iDrac reset api
Change-Id: Iec4e59341fd8a976b6aeda30d0671839643b04bf
2022-08-25 19:19:57 +00:00
..
.openapi-generator Add iDrac reset api 2022-08-25 19:19:57 +00:00
api Add iDrac reset api 2022-08-25 19:19:57 +00:00
docs Add iDrac reset api 2022-08-25 19:19:57 +00:00
.gitignore computerSystem api support 2019-09-08 23:55:37 +03:00
.openapi-generator-ignore computerSystem api support 2019-09-08 23:55:37 +03:00
.travis.yml computerSystem api support 2019-09-08 23:55:37 +03:00
api_default.go Add iDrac reset api 2022-08-25 19:19:57 +00:00
client.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
configuration.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
git_push.sh Regenerated code using openapi-generator 4.2.2 2020-01-10 18:53:05 +00:00
go.mod Fixed a name typo in go.mod 2021-08-04 20:51:12 +00:00
go.sum Fixed a name typo in go.mod 2021-08-04 20:51:12 +00:00
model_boot_source_override_enabled.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_boot_source.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_boot.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_collection.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_computer_system_actions.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_computer_system_reset.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_computer_system.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_connected_via.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_create_virtual_disk_request_body.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_firmware_inventory.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_health.go Add "Unknown" value to health state enum 2021-10-04 14:36:11 -04:00
model_id_ref.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_idrac_reset_request_body.go Add iDrac reset api 2022-08-25 19:19:57 +00:00
model_idrac_reset_type.go Add iDrac reset api 2022-08-25 19:19:57 +00:00
model_indicator_led.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_inline_object.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_insert_media_request_body.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_manager_links.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_manager_type.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_manager.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_memory_summary.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_message.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_payload.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_power_state.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_processor_summary.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_redfish_error_error.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_redfish_error.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_reset_request_body.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_reset_type.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_root.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_simple_update_request_body.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_software_inventory.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_state.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_status.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_system_links.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_task_state.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_task.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_transfer_method.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_transfer_protocol_type.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_update_service_actions.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_update_service.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_virtual_media_actions__virtual_media_eject_media.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_virtual_media_actions.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_virtual_media.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
model_volume_type.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
README.md Add iDrac reset api 2022-08-25 19:19:57 +00:00
response.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00
utils.go Upgrade openapi generator to v5.1.0 2021-05-05 10:18:32 -04:00

Go API client for client

Partial Redfish OAPI specification for a limited client

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.0.1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./client"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
DefaultApi CreateVirtualDisk Post /redfish/v1/Systems/{ComputerSystemId}/Storage/{StorageControllerId}/Volumes
DefaultApi DeleteVirtualdisk Delete /redfish/v1/Systems/{ComputerSystemId}/Storage/Volumes/{StorageId}
DefaultApi EjectVirtualMedia Post /redfish/v1/Managers/{managerId}/VirtualMedia/{virtualMediaId}/Actions/VirtualMedia.EjectMedia
DefaultApi FirmwareInventory Get /redfish/v1/UpdateService/FirmwareInventory
DefaultApi FirmwareInventoryDownloadImage Post /redfish/v1/UpdateService/FirmwareInventory
DefaultApi GetManager Get /redfish/v1/Managers/{managerId}
DefaultApi GetManagerVirtualMedia Get /redfish/v1/Managers/{managerId}/VirtualMedia/{virtualMediaId}
DefaultApi GetRoot Get /redfish/v1
DefaultApi GetSoftwareInventory Get /redfish/v1/UpdateService/FirmwareInventory/{softwareId}
DefaultApi GetSystem Get /redfish/v1/Systems/{systemId}
DefaultApi GetTask Get /redfish/v1/TaskService/Tasks/{taskId}
DefaultApi GetTaskList Get /redfish/v1/TaskService/Tasks
DefaultApi GetVolumes Get /redfish/v1/Systems/{ComputerSystemId}/Storage/{StorageControllerId}/Volumes
DefaultApi InsertVirtualMedia Post /redfish/v1/Managers/{managerId}/VirtualMedia/{virtualMediaId}/Actions/VirtualMedia.InsertMedia
DefaultApi ListManagerVirtualMedia Get /redfish/v1/Managers/{managerId}/VirtualMedia
DefaultApi ListManagers Get /redfish/v1/Managers
DefaultApi ListSystems Get /redfish/v1/Systems
DefaultApi ResetIdrac Post /redfish/v1/Managers/iDRAC.Embedded.1/Actions/Manager.Reset
DefaultApi ResetSystem Post /redfish/v1/Systems/{ComputerSystemId}/Actions/ComputerSystem.Reset
DefaultApi SetSystem Patch /redfish/v1/Systems/{systemId}
DefaultApi UpdateService Get /redfish/v1/UpdateService
DefaultApi UpdateServiceSimpleUpdate Post /redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author