Skip to content

Latest commit

 

History

History
427 lines (380 loc) · 36.7 KB

File metadata and controls

427 lines (380 loc) · 36.7 KB

Go API client for client

This API provides a RESTful interface to all the Solar services e.g. looking for boards, building projects, etc.

  • This API uses Hypermedia as the Engine of Application State (HATEOAS) to drive the discovery and provide affordances.
  • Discovery is possible by following links from the well known root resource. While this specification lists all supported endpoints, it is only recommended that these are hard coded into a client if code generation is being used. Otherwise, it is recommended that the discovery mechanisms present in the resources (affordances) are used exclusively.
  • Affordances are links which indicate whether an action is currently possible, this is significantly different from whether the service supports an action in general. This specification defines what actions could be possible, but only by checking the affordances returned by the API in the returned resources, can a client determine whether this action is currently possible or available for the current user. For example:
    • An operation to modify a resource could be defined in this specification, but the user may lack the appropriate privileges. In that situation, the affordance link would not be present in the resource when read. Therefore, the client can infer that it is not possible to edit this resource and present appropriate information to the user.
    • An operation to delete a resource could be defined and be possible in some circumstances. The specification describes that the delete is supported and how to use it, but the affordance describes whether it is currently possible. The logic in the API may dictate that if the resource was in use (perhaps it is a running job or used by another resource), then it will not be possible to delete that resource as it would result in a conflicted state.
  • It is strongly encouraged that affordances are used by all clients, even those using code generation. This has the ability to both improve robustness and the user experience by decoupling the client and server. For example, if for some reason the criteria for deleting a resource changes, the logic is only implemented in the server and there is no need to update the logic in the client as it is driven by the affordances.
  • The format used for the resources is the Hypertext Application Language (HAL), which includes the definition of links and embedded resources.

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: 1.1.1
  • Package version: 1.0.0
  • Generator version: 7.13.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.keil.com/

Installation

Install the following dependencies:

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

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

import client "github.com/ARM-software/embedded-development-services-client/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 client.ContextServerIndex of type int.

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

Templated Server URL

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

ctx := context.WithValue(context.Background(), client.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 identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using client.ContextOperationServerIndices and client.ContextOperationServerVariables context maps.

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

Documentation for API Endpoints

All URIs are relative to https://all.api.keil.arm.com

Class Method HTTP request Description
AuthenticationAPI CreateUser Post /users/ Create a user.
AuthenticationAPI GetMe Get /users/me Get my user information
AuthenticationAPI GetUser Get /users/{userName} Get user information
AuthenticationAPI InviteUser Post /users/invite Invite a user.
AuthenticationAPI ListUsers Get /users/ List all users
AuthenticationAPI TokenIntrospect Post /token/introspect Introspect a token.
AuthorizationAPI CheckEntitlements Post /entitlements/check Check permissions on a resource.
AuthorizationAPI GetResourceInstanceEntitlements Get /users/{userName}/entitlements/{resourceType}/instances/{resourceInstanceName} Return details of the user's permissions for a resource instance.
AuthorizationAPI GetResourceTypeEntitlements Get /users/{userName}/entitlements/{resourceType} Return details of the user's permissions for a resource type.
AuthorizationAPI ListResourceInstanceEntitlements Get /users/{userName}/entitlements/{resourceType}/instances List the user's permissions for all instances of a resource type.
BuildJobsAPI CancelBuildJob Post /build-jobs/{jobName}/cancel Cancel a Build Job
BuildJobsAPI DeleteBuildJob Delete /build-jobs/{jobName} Delete a Build Job
BuildJobsAPI GetBuildArtefact Get /build-jobs/{jobName}/artefacts/{artefactName} Download the named Build Artefact for the given Build Job.
BuildJobsAPI GetBuildJob Get /build-jobs/{jobName} Return status of a Build Job.
BuildJobsAPI GetBuildJobArtefactManager Get /build-jobs/{jobName}/outputs/{artefactName} Get the corresponding Build Job artefact manager.
BuildJobsAPI GetBuildMessages Get /build-jobs/{jobName}/messages Build Message Feed.
BuildJobsAPI GetBuildOutputArtefact Get /build-jobs/{jobName}/outputs/{artefactName}/artefact Download the build artefact for the given build job.
BuildJobsAPI ListBuildArtefacts Get /build-jobs/{jobName}/artefacts/ List all the available Build Artefacts for the given Build Job.
BuildJobsAPI ListBuildJob Get /build-jobs/ List all Build Jobs.
BuildJobsAPI ListBuildOutputManagers Get /build-jobs/{jobName}/outputs/ List all the available managers of Build Artefacts for the given Build Job.
BuildJobsAPI RetainBuildJob Post /build-jobs/{jobName}/retain Update how long a build job will be retained before automatic deletion.
CMSISBuildersAPI GetCmsisBuilder Get /cmsis-builders/{builderName} Return details of specific CMSIS Builders.
CMSISBuildersAPI ListCmsisBuilders Get /cmsis-builders/ List available CMSIS Builders.
CMSISBuildersAPI StartCmsisBuild Post /cmsis-builders/{builderName} Initiate a build using the specified CMSIS Builder.
CMSISIntellisenseBuildersAPI GetCmsisIntellisense Get /cmsis-intellisense/{builderName} Return details of specific CMSIS Intellisense Builders.
CMSISIntellisenseBuildersAPI ListCmsisIntellisense Get /cmsis-intellisense/ List available CMSIS Intellisense Builders.
CMSISIntellisenseBuildersAPI StartCmsisIntellisense Post /cmsis-intellisense/{builderName} Initiate a compilation database generation using the specified CMSIS Intellisense Builder.
DeprecationNoticeAPI GetDeprecationNotice Get /deprecations/{operationName} Return details of specific endpoint deprecation notice.
DeprecationNoticeAPI ListDeprecatedEndpoints Get /deprecations/ Get the endpoints that have been deprecated with some notice.
FPGAAdminAPI AddFPGAAdmin Post /fpga-admins Add a user to the FPGA admin group
FPGAAdminAPI ListFPGAAdmins Get /fpga-admins List all the members of the FPGA admin group
FPGAAdminAPI RemoveFPGAAdmin Delete /fpga-admins/{fpgaAdminName} Remove a user from the FPGA admin group
FPGAConnectionAPI GetFpgaConnection Get /fpga-connections/{connectionName} Get connection information
FPGAConnectionAPI ListFpgaConnections Get /fpga-connections/ List available FPGA connections.
FPGAConnectionAPI StartFpgaConnection Get /fpga-connections/{connectionName}/connect starts a websocket connection
FPGAConnectionAPI TerminateFpgaConnection Post /fpga-connections/{connectionName}/terminate Terminates all websocket connections to the application running on the FPGA
FPGAEntitlementsAPI GetFpgaEntitlement Get /fpga-entitlements/{fpgaEntitlementName} Return details of specific FPGA entitlement.
FPGAEntitlementsAPI UpdateFPGAEntitlement Put /fpga-entitlements Update an FPGA entitlement that defines which users are permitted to interact with an FPGA.
FPGAJobsAPI CancelFpgaJob Post /fpga-jobs/{jobName}/cancel Cancel an FPGA job.
FPGAJobsAPI ClearFpgaJobArtefact Delete /fpga-jobs/{jobName}/artefacts/{artefactName}/artefact Clear the job artefact.
FPGAJobsAPI CreateFpgaJobArtefactManager Post /fpga-jobs/{jobName}/artefacts/ Create a job artefact manager.
FPGAJobsAPI DeleteFpgaJob Delete /fpga-jobs/{jobName} Delete an FPGA job.
FPGAJobsAPI DownloadFpgaJobArtefact Get /fpga-jobs/{jobName}/artefacts/{artefactName}/artefact Download the artefact for the corresponding FPGA job.
FPGAJobsAPI GetCurrentFpgaJob Get /fpgas/{fpgaName}/current-job Return the job currently handled by the FPGA.
FPGAJobsAPI GetFpgaJob Get /fpga-jobs/{jobName} Return the status of a FPGA job.
FPGAJobsAPI GetFpgaJobArtefactManager Get /fpga-jobs/{jobName}/artefacts/{artefactName} Get the job's artefact manager for the artefact named `artefactName`.
FPGAJobsAPI GetFpgaJobMessages Get /fpga-jobs/{jobName}/messages FPGA job Message Feed.
FPGAJobsAPI ListFPGAJobs Get /fpgas/{fpgaName}/jobs/ List all jobs associated with this FPGA.
FPGAJobsAPI ListFPGAPastJobs Get /fpgas/{fpgaName}/past-jobs/ List all past jobs associated with this FPGA.
FPGAJobsAPI ListFPGAQueuedJobs Get /fpgas/{fpgaName}/queued-jobs/ List all jobs associated with this FPGA and currently queued up.
FPGAJobsAPI ListFPGAsJobs Get /fpga-jobs/ List all jobs performed by FPGAs.
FPGAJobsAPI ListFpgaJobArtefactManagers Get /fpga-jobs/{jobName}/artefacts/ Get the list of artefact managers for the given job.
FPGAJobsAPI LogJobMessage Post /fpga-jobs/{jobName}/messages Create a job message.
FPGAJobsAPI RetainFpgaJob Post /fpga-jobs/{jobName}/retain Update how long an FPGA job will be retained before automatic deletion.
FPGAJobsAPI StartFpgaJob Post /fpgas/{fpgaName} Initiate a job on an FPGA.
FPGAJobsAPI UploadFpgaJobArtefact Put /fpga-jobs/{jobName}/artefacts/{artefactName}/artefact Upload and replace the named artefact.
FPGAPayloadsAPI CreateFPGAPayload Post /repositories/{repositoryName}/payloads Create an FPGA payload.
FPGAPayloadsAPI CreateFPGAPayloadUploadSession Post /payloads/upload-session Create upload session for FPGA payload.
FPGAPayloadsAPI DeleteFpgaPayload Delete /repositories/{repositoryName}/payloads/{fpgaPayloadName} Delete an FPGA payload.
FPGAPayloadsAPI GetFpgaPayload Get /repositories/{repositoryName}/payloads/{fpgaPayloadName} Return details of specific FPGA payload.
FPGAPayloadsAPI GetFpgaPayloadUploadOptions Options /payloads/upload-session Return service TUS protocol support.
FPGAPayloadsAPI GetFpgaPayloadUploadProgress Head /payloads/upload-session/{uploadSessionName} Return FPGA payload upload progress.
FPGAPayloadsAPI ListFPGAPayloads Get /repositories/{repositoryName}/payloads List payloads in a repository.
FPGAPayloadsAPI ListPayloads Get /payloads List payloads.
FPGAPayloadsAPI UploadPayload Patch /payloads/upload-session/{uploadSessionName} Upload part of a payload.
FPGAsAPI CommissionFpga Post /fpgas/ Commission a new FPGA.
FPGAsAPI DecommissionFpga Delete /fpgas/{fpgaName} Decommission an FPGA.
FPGAsAPI GetFpga Get /fpgas/{fpgaName} Return details of specific FPGA.
FPGAsAPI ListFPGAWorkers Get /fpgas/ List available FPGAs.
FPGAsAPI UpdateFpga Put /fpgas/{fpgaName} Update the status of the FPGA.
GenericWorkJobsAPI CancelGenericWorkJob Post /generic-work-jobs/{jobName}/cancel Cancel a generic job.
GenericWorkJobsAPI DeleteGenericWorkJob Delete /generic-work-jobs/{jobName} Delete a generic job.
GenericWorkJobsAPI GetGenericWorkJob Get /generic-work-jobs/{jobName} Return the status of a Generic Work Job.
GenericWorkJobsAPI GetGenericWorkJobArtefactManager Get /generic-work-jobs/{jobName}/artefacts/{artefactName} Get the job's artefact manager for the artefact named `artefactName`.
GenericWorkJobsAPI GetGenericWorkJobMessages Get /generic-work-jobs/{jobName}/messages GenericWorkJob Message Feed.
GenericWorkJobsAPI GetGenericWorkJobOutputArtefact Get /generic-work-jobs/{jobName}/artefacts/{artefactName}/artefact Download the artefact for the corresponding generic work job.
GenericWorkJobsAPI ListGenericWorkJobArtefactManagers Get /generic-work-jobs/{jobName}/artefacts/ Get the list of artefact managers for the given job.
GenericWorkJobsAPI ListGenericWorkJobs Get /generic-work-jobs/ List all jobs performed by generic workers.
GenericWorkJobsAPI RetainGenericWorkJob Post /generic-work-jobs/{jobName}/retain Update how long a generic work job will be retained before automatic deletion.
GenericWorkersAPI GetGenericWorker Get /generic-workers/{genericWorkerName} Return details of specific Generic Workers.
GenericWorkersAPI ListGenericWorkers Get /generic-workers/ List available Generic Workers.
GenericWorkersAPI StartGenericWorkJob Post /generic-workers/{genericWorkerName} Initiate a job using the specified Generic Worker.
IntellisenseJobsAPI CancelIntellisenseJob Post /intellisense-jobs/{jobName}/cancel Cancel an Intellisense Job.
IntellisenseJobsAPI DeleteIntellisenseJob Delete /intellisense-jobs/{jobName} Delete an Intellisense Job.
IntellisenseJobsAPI GetIntellisenseArtefact Get /intellisense-jobs/{jobName}/artefacts/{artefactName} Download the named Intellisense Artefact for the given Intellisense Job.
IntellisenseJobsAPI GetIntellisenseJob Get /intellisense-jobs/{jobName} Return status of an Intellisense Job.
IntellisenseJobsAPI GetIntellisenseJobArtefactManager Get /intellisense-jobs/{jobName}/outputs/{artefactName} Get the Intellisense Job artefact manager for the artefact named `artefactName` present of this Build Job.
IntellisenseJobsAPI GetIntellisenseMessages Get /intellisense-jobs/{jobName}/messages Intellisense Message Feed.
IntellisenseJobsAPI GetIntellisenseOutputArtefact Get /intellisense-jobs/{jobName}/outputs/{artefactName}/artefact Download the artefact for the corresponding Intellisense job.
IntellisenseJobsAPI ListIntellisenseArtefacts Get /intellisense-jobs/{jobName}/artefacts/ List all the available Intellisense Artefacts for the given Intellisense Job.
IntellisenseJobsAPI ListIntellisenseJob Get /intellisense-jobs/ List all Intellisense Jobs.
IntellisenseJobsAPI ListIntellisenseOutputManagers Get /intellisense-jobs/{jobName}/outputs/ Get the list of artefact managers for the given Intellisense job.
IntellisenseJobsAPI RetainIntellisenseJob Post /intellisense-jobs/{jobName}/retain Update how long an intellisense job will be retained before automatic deletion.
PersonalAccessTokenAPI CreatePAT Post /personal-access-tokens/ Create a new personal access token for a user
PersonalAccessTokenAPI DeletePAT Delete /personal-access-tokens/{patName} Delete a personal access token
PersonalAccessTokenAPI GetPAT Get /personal-access-tokens/{patName} Get a personal access token
PersonalAccessTokenAPI ListPATs Get /personal-access-tokens/ List all personal access tokens for the user
RootResourceAPI GetRoot Get / Get the Root resource.
VHTRunJobsAPI CancelVhtRunJob Post /vht-run-jobs/{jobName}/cancel Cancel a VHT run job.
VHTRunJobsAPI DeleteVhtRunJob Delete /vht-run-jobs/{jobName} Delete an VHT run Job.
VHTRunJobsAPI GetVhtRunJob Get /vht-run-jobs/{jobName} Return status of an VHT run Job.
VHTRunJobsAPI GetVhtRunJobMessages Get /vht-run-jobs/{jobName}/messages VHT Run Job Message Feed.
VHTRunJobsAPI ListVhtRunJobs Get /vht-run-jobs/ List all run jobs on VHTs.
VendorsAPI CreateVendor Post /vendors/ Create a new Vendor
VendorsAPI GetVendor Get /vendors/{vendorSlugOrId}/ Get a Vendor Item
VendorsAPI ListVendors Get /vendors/ List all the Vendors.
VirtualHardwareTargetAPI GetVht Get /vhts/{vhtName} Return details of the specific VHT.
VirtualHardwareTargetAPI ListFilteredVhtInstances Get /vhts/{vhtName}/vht-instances/ List all VHT instances related to this specific VHT.
VirtualHardwareTargetAPI ListVhts Get /vhts/ List available VHTs.
VirtualHardwareTargetAPI StartVhtInstance Post /vhts/{vhtName} Spawns a VHT instance matching this VHT specification.
VirtualHardwareTargetInstanceAPI ClearVhtInstanceArtefact Delete /vht-instances/{instanceName}/artefacts/{artefactName}/artefact Clear the VHT artefact from the VHT instance.
VirtualHardwareTargetInstanceAPI DeleteVhtInstance Delete /vht-instances/{instanceName} Delete a VHT instance
VirtualHardwareTargetInstanceAPI DownloadVhtInstanceArtefact Get /vht-instances/{instanceName}/artefacts/{artefactName}/artefact Download the artefact named `artefactName` present on this VHT instance.
VirtualHardwareTargetInstanceAPI GetVhtInstance Get /vht-instances/{instanceName} Return status of a VHT instance.
VirtualHardwareTargetInstanceAPI GetVhtInstanceArtefactManager Get /vht-instances/{instanceName}/artefacts/{artefactName} Get the VHT artefact manager for the artefact named `artefactName` present of this VHT instance.
VirtualHardwareTargetInstanceAPI GetVhtInstanceMessages Get /vht-instances/{instanceName}/messages Instance Message Feed.
VirtualHardwareTargetInstanceAPI ListVhtInstanceArtefactManagers Get /vht-instances/{instanceName}/artefacts/ List all the managers of the artefacts (e.g. binary, test input) available on a specific VHT instance.
VirtualHardwareTargetInstanceAPI ListVhtInstances Get /vht-instances/ List all VHT instances requested.
VirtualHardwareTargetInstanceAPI StartVhtRunJob Post /vht-instances/{instanceName} Starts a VHT Run job.
VirtualHardwareTargetInstanceAPI StopVhtInstance Post /vht-instances/{instanceName}/cancel Stop this VHT instance.
VirtualHardwareTargetInstanceAPI UploadVhtInstanceArtefact Put /vht-instances/{instanceName}/artefacts/{artefactName}/artefact Upload and replace the named VHT artefact on the given VHT instance.
WorkspaceAPI ClearWorkspaceArchiveContent Delete /workspaces/{workspaceName}/archive-content Clear the content of this workspace.
WorkspaceAPI ClearWorkspaceRepositoryContentManager Delete /workspaces/{workspaceName}/repository-content Clear the content of this workspace.
WorkspaceAPI CreateWorkspace Post /workspace-sources/{workspaceSourceName} Creates a workspace based on the source.
WorkspaceAPI DeleteWorkspace Delete /workspaces/{workspaceName} Delete a Workspace
WorkspaceAPI EditWorkspaceRepositoryContentManager Put /workspaces/{workspaceName}/repository-content Edit the source for the content of the workspace.
WorkspaceAPI GetWorkspace Get /workspaces/{workspaceName} Return the state of a workspace.
WorkspaceAPI GetWorkspaceArchiveContent Get /workspaces/{workspaceName}/archive-content Get the manager of the archive file containing the workspace content.
WorkspaceAPI GetWorkspaceDetails Get /workspaces/{workspaceName}/details Details about the workspace.
WorkspaceAPI GetWorkspaceRepositoryContentManager Get /workspaces/{workspaceName}/repository-content Get the manager of the workspace content defined in a repository.
WorkspaceAPI ListWorkspaces Get /workspaces/ List all workspaces available.
WorkspaceAPI RetainWorkspace Post /workspaces/{workspaceName}/retain Update how long a workspace will be retained before automatic deletion..
WorkspaceAPI UploadWorkspaceArchiveContent Put /workspaces/{workspaceName}/archive-content Upload and replace the content of the named workspace.
WorkspaceSourceAPI GetWorkspaceSource Get /workspace-sources/{workspaceSourceName} Return details of the specific workspace source.
WorkspaceSourceAPI ListWorkspaceSources Get /workspace-sources/ List available workspace sources.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

JWTAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), client.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

TokenAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), client.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

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

support@arm.com