Categorygithub.com/ARM-software/embedded-development-services-client/client

# README

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.7.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

ClassMethodHTTP requestDescription
BuildJobsAPICancelBuildJobPost /build-jobs/{jobName}/cancelCancel a Build Job
BuildJobsAPIDeleteBuildJobDelete /build-jobs/{jobName}Delete a Build Job
BuildJobsAPIGetBuildArtefactGet /build-jobs/{jobName}/artefacts/{artefactName}Download the named Build Artefact for the given Build Job.
BuildJobsAPIGetBuildJobGet /build-jobs/{jobName}Return status of a Build Job.
BuildJobsAPIGetBuildJobArtefactManagerGet /build-jobs/{jobName}/outputs/{artefactName}Get the corresponding Build Job artefact manager.
BuildJobsAPIGetBuildMessagesGet /build-jobs/{jobName}/messagesBuild Message Feed.
BuildJobsAPIGetBuildOutputArtefactGet /build-jobs/{jobName}/outputs/{artefactName}/artefactDownload the build artefact for the given build job.
BuildJobsAPIListBuildArtefactsGet /build-jobs/{jobName}/artefacts/List all the available Build Artefacts for the given Build Job.
BuildJobsAPIListBuildJobGet /build-jobs/List all Build Jobs.
BuildJobsAPIListBuildOutputManagersGet /build-jobs/{jobName}/outputs/List all the available managers of Build Artefacts for the given Build Job.
BuildJobsAPIRetainBuildJobPost /build-jobs/{jobName}/retainUpdate how long a build job will be retained before automatic deletion.
CMSISBuildersAPIGetCmsisBuilderGet /cmsis-builders/{builderName}Return details of specific CMSIS Builders.
CMSISBuildersAPIListCmsisBuildersGet /cmsis-builders/List available CMSIS Builders.
CMSISBuildersAPIStartCmsisBuildPost /cmsis-builders/{builderName}Initiate a build using the specified CMSIS Builder.
CMSISIntellisenseBuildersAPIGetCmsisIntellisenseGet /cmsis-intellisense/{builderName}Return details of specific CMSIS Intellisense Builders.
CMSISIntellisenseBuildersAPIListCmsisIntellisenseGet /cmsis-intellisense/List available CMSIS Intellisense Builders.
CMSISIntellisenseBuildersAPIStartCmsisIntellisensePost /cmsis-intellisense/{builderName}Initiate a compilation database generation using the specified CMSIS Intellisense Builder.
DeprecationNoticeAPIGetDeprecationNoticeGet /deprecations/{operationName}Return details of specific endpoint deprecation notice.
DeprecationNoticeAPIListDeprecatedEndpointsGet /deprecations/Get the endpoints that have been deprecated with some notice.
GenericWorkJobsAPICancelGenericWorkJobPost /generic-work-jobs/{jobName}/cancelCancel a generic job.
GenericWorkJobsAPIDeleteGenericWorkJobDelete /generic-work-jobs/{jobName}Delete a generic job.
GenericWorkJobsAPIGetGenericWorkJobGet /generic-work-jobs/{jobName}Return the status of a Generic Work Job.
GenericWorkJobsAPIGetGenericWorkJobArtefactManagerGet /generic-work-jobs/{jobName}/artefacts/{artefactName}Get the job's artefact manager for the artefact named `artefactName`.
GenericWorkJobsAPIGetGenericWorkJobMessagesGet /generic-work-jobs/{jobName}/messagesGenericWorkJob Message Feed.
GenericWorkJobsAPIGetGenericWorkJobOutputArtefactGet /generic-work-jobs/{jobName}/artefacts/{artefactName}/artefactDownload the artefact for the corresponding generic work job.
GenericWorkJobsAPIListGenericWorkJobArtefactManagersGet /generic-work-jobs/{jobName}/artefacts/Get the list of artefact managers for the given job.
GenericWorkJobsAPIListGenericWorkJobsGet /generic-work-jobs/List all jobs performed by generic workers.
GenericWorkJobsAPIRetainGenericWorkJobPost /generic-work-jobs/{jobName}/retainUpdate how long a generic work job will be retained before automatic deletion.
GenericWorkersAPIGetGenericWorkerGet /generic-workers/{genericWorkerName}Return details of specific Generic Workers.
GenericWorkersAPIListGenericWorkersGet /generic-workers/List available Generic Workers.
GenericWorkersAPIStartGenericWorkJobPost /generic-workers/{genericWorkerName}Initiate a job using the specified Generic Worker.
IntellisenseJobsAPICancelIntellisenseJobPost /intellisense-jobs/{jobName}/cancelCancel an Intellisense Job.
IntellisenseJobsAPIDeleteIntellisenseJobDelete /intellisense-jobs/{jobName}Delete an Intellisense Job.
IntellisenseJobsAPIGetIntellisenseArtefactGet /intellisense-jobs/{jobName}/artefacts/{artefactName}Download the named Intellisense Artefact for the given Intellisense Job.
IntellisenseJobsAPIGetIntellisenseJobGet /intellisense-jobs/{jobName}Return status of an Intellisense Job.
IntellisenseJobsAPIGetIntellisenseJobArtefactManagerGet /intellisense-jobs/{jobName}/outputs/{artefactName}Get the Intellisense Job artefact manager for the artefact named `artefactName` present of this Build Job.
IntellisenseJobsAPIGetIntellisenseMessagesGet /intellisense-jobs/{jobName}/messagesIntellisense Message Feed.
IntellisenseJobsAPIGetIntellisenseOutputArtefactGet /intellisense-jobs/{jobName}/outputs/{artefactName}/artefactDownload the artefact for the corresponding Intellisense job.
IntellisenseJobsAPIListIntellisenseArtefactsGet /intellisense-jobs/{jobName}/artefacts/List all the available Intellisense Artefacts for the given Intellisense Job.
IntellisenseJobsAPIListIntellisenseJobGet /intellisense-jobs/List all Intellisense Jobs.
IntellisenseJobsAPIListIntellisenseOutputManagersGet /intellisense-jobs/{jobName}/outputs/Get the list of artefact managers for the given Intellisense job.
IntellisenseJobsAPIRetainIntellisenseJobPost /intellisense-jobs/{jobName}/retainUpdate how long an intellisense job will be retained before automatic deletion.
PersonalAccessTokenAPICreatePATPost /personal-access-tokens/Create a new personal access token for a user
PersonalAccessTokenAPIDeletePATDelete /personal-access-tokens/{patName}Delete a personal access token
PersonalAccessTokenAPIGetPATGet /personal-access-tokens/{patName}Get a personal access token
PersonalAccessTokenAPIListPATsGet /personal-access-tokens/List all personal access tokens for the user
RootResourceAPIGetRootGet /Get the Root resource.
VHTRunJobsAPICancelVhtRunJobPost /vht-run-jobs/{jobName}/cancelCancel a VHT run job.
VHTRunJobsAPIDeleteVhtRunJobDelete /vht-run-jobs/{jobName}Delete an VHT run Job.
VHTRunJobsAPIGetVhtRunJobGet /vht-run-jobs/{jobName}Return status of an VHT run Job.
VHTRunJobsAPIGetVhtRunJobMessagesGet /vht-run-jobs/{jobName}/messagesVHT Run Job Message Feed.
VHTRunJobsAPIListVhtRunJobsGet /vht-run-jobs/List all run jobs on VHTs.
VendorsAPICreateVendorPost /vendors/Create a new Vendor
VendorsAPIGetVendorGet /vendors/{vendorSlugOrId}/Get a Vendor Item
VendorsAPIListVendorsGet /vendors/List all the Vendors.
VirtualHardwareTargetAPIGetVhtGet /vhts/{vhtName}Return details of the specific VHT.
VirtualHardwareTargetAPIListFilteredVhtInstancesGet /vhts/{vhtName}/vht-instances/List all VHT instances related to this specific VHT.
VirtualHardwareTargetAPIListVhtsGet /vhts/List available VHTs.
VirtualHardwareTargetAPIStartVhtInstancePost /vhts/{vhtName}Spawns a VHT instance matching this VHT specification.
VirtualHardwareTargetInstanceAPIClearVhtInstanceArtefactDelete /vht-instances/{instanceName}/artefacts/{artefactName}/artefactClear the VHT artefact from the VHT instance.
VirtualHardwareTargetInstanceAPIDeleteVhtInstanceDelete /vht-instances/{instanceName}Delete a VHT instance
VirtualHardwareTargetInstanceAPIDownloadVhtInstanceArtefactGet /vht-instances/{instanceName}/artefacts/{artefactName}/artefactDownload the artefact named `artefactName` present on this VHT instance.
VirtualHardwareTargetInstanceAPIGetVhtInstanceGet /vht-instances/{instanceName}Return status of a VHT instance.
VirtualHardwareTargetInstanceAPIGetVhtInstanceArtefactManagerGet /vht-instances/{instanceName}/artefacts/{artefactName}Get the VHT artefact manager for the artefact named `artefactName` present of this VHT instance.
VirtualHardwareTargetInstanceAPIGetVhtInstanceMessagesGet /vht-instances/{instanceName}/messagesInstance Message Feed.
VirtualHardwareTargetInstanceAPIListVhtInstanceArtefactManagersGet /vht-instances/{instanceName}/artefacts/List all the managers of the artefacts (e.g. binary, test input) available on a specific VHT instance.
VirtualHardwareTargetInstanceAPIListVhtInstancesGet /vht-instances/List all VHT instances requested.
VirtualHardwareTargetInstanceAPIStartVhtRunJobPost /vht-instances/{instanceName}Starts a VHT Run job.
VirtualHardwareTargetInstanceAPIStopVhtInstancePost /vht-instances/{instanceName}/cancelStop this VHT instance.
VirtualHardwareTargetInstanceAPIUploadVhtInstanceArtefactPut /vht-instances/{instanceName}/artefacts/{artefactName}/artefactUpload and replace the named VHT artefact on the given VHT instance.
WorkspaceAPIClearWorkspaceArchiveContentDelete /workspaces/{workspaceName}/archive-contentClear the content of this workspace.
WorkspaceAPIClearWorkspaceRepositoryContentManagerDelete /workspaces/{workspaceName}/repository-contentClear the content of this workspace.
WorkspaceAPICreateWorkspacePost /workspace-sources/{workspaceSourceName}Creates a workspace based on the source.
WorkspaceAPIDeleteWorkspaceDelete /workspaces/{workspaceName}Delete a Workspace
WorkspaceAPIEditWorkspaceRepositoryContentManagerPut /workspaces/{workspaceName}/repository-contentEdit the source for the content of the workspace.
WorkspaceAPIGetWorkspaceGet /workspaces/{workspaceName}Return the state of a workspace.
WorkspaceAPIGetWorkspaceArchiveContentGet /workspaces/{workspaceName}/archive-contentGet the manager of the archive file containing the workspace content.
WorkspaceAPIGetWorkspaceDetailsGet /workspaces/{workspaceName}/detailsDetails about the workspace.
WorkspaceAPIGetWorkspaceRepositoryContentManagerGet /workspaces/{workspaceName}/repository-contentGet the manager of the workspace content defined in a repository.
WorkspaceAPIListWorkspacesGet /workspaces/List all workspaces available.
WorkspaceAPIRetainWorkspacePost /workspaces/{workspaceName}/retainUpdate how long a workspace will be retained before automatic deletion..
WorkspaceAPIUploadWorkspaceArchiveContentPut /workspaces/{workspaceName}/archive-contentUpload and replace the content of the named workspace.
WorkspaceSourceAPIGetWorkspaceSourceGet /workspace-sources/{workspaceSourceName}Return details of the specific workspace source.
WorkspaceSourceAPIListWorkspaceSourcesGet /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

[email protected]