peridot/vendor/openapi.peridot.resf.org/peridotopenapi/README.md
2022-10-30 02:59:43 +01:00

13 KiB

Go API client for peridotopenapi

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

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: version not set
  • 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 "./peridotopenapi"

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
BuildServiceApi GetBuild Get /v1/projects/{projectId}/builds/{buildId} GetBuild returns a build by its id
BuildServiceApi GetBuildBatch Get /v1/projects/{projectId}/build_batches/{buildBatchId} GetBuildBatch returns a build batch by its id
BuildServiceApi ListBuildBatches Get /v1/projects/{projectId}/build_batches ListBuildBatches returns all build batches
BuildServiceApi ListBuilds Get /v1/projects/{projectId}/builds ListBuilds returns all builds filtered through given filters
BuildServiceApi RpmImport Post /v1/projects/{projectId}/builds/rpm-import RpmImport imports rpm files into a project (packaged into tar format)
BuildServiceApi RpmLookasideBatchImport Post /v1/projects/{projectId}/builds/rpm-lookaside-batch-import RpmLookasideBatchImport imports rpm files into a project (stored in Lookaside)
BuildServiceApi SubmitBuild Post /v1/projects/{projectId}/builds SubmitBuild builds a package scoped to a project The project has to contain an import for the specific package This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information
BuildServiceApi SubmitBuildBatch Post /v1/projects/{projectId}/build_batches SubmitBuildBatch submits a batch of builds.
ImportServiceApi GetImport Get /v1/projects/{projectId}/imports/{importId} GetImport gets an import by ID.
ImportServiceApi GetImportBatch Get /v1/projects/{projectId}/import_batches/{importBatchId} GetImportBatch gets an import batch by ID.
ImportServiceApi ImportBatchRetryFailed Post /v1/projects/{projectId}/import_batches/{importBatchId}/retry_failed ImportBatchRetryFailed retries failed imports in a batch.
ImportServiceApi ImportPackage Post /v1/projects/{projectId}/imports ImportPackage imports a package scoped to a project This method is asynchronous. Peridot uses the AsyncTask abstraction. Check out `//peridot/proto/v1:task.proto` for more information TODO low-pri: Support inter-project imports
ImportServiceApi ImportPackageBatch Post /v1/projects/{projectId}/import_batches ImportPackageBatch imports a batch of packages scoped to a project
ImportServiceApi ListImportBatches Get /v1/projects/{projectId}/import_batches ListImportBatches lists all import batches for a project.
ImportServiceApi ListImports Get /v1/projects/{projectId}/imports ListImports lists all imports for a project.
PackageServiceApi GetPackage Get /v1/projects/{projectId}/packages/{field}/{value} GetPackage returns a package by its id or name
PackageServiceApi ListPackages Get /v1/projects/{projectId}/packages ListPackages returns all packages with filters applied
ProjectServiceApi CreateHashedRepositories Post /v1/projects/{projectId}/repositories/hashed
ProjectServiceApi CreateProject Post /v1/projects
ProjectServiceApi DeleteExternalRepository Delete /v1/projects/{projectId}/external_repositories/{id}
ProjectServiceApi GetProject Get /v1/projects/{id}
ProjectServiceApi GetProjectCredentials Get /v1/projects/{projectId}/credentials
ProjectServiceApi GetRepository Get /v1/projects/{projectId}/repositories/{id}
ProjectServiceApi ListExternalRepositories Get /v1/projects/{projectId}/external_repositories
ProjectServiceApi ListProjects Get /v1/projects
ProjectServiceApi ListRepositories Get /v1/projects/{projectId}/repositories
ProjectServiceApi LookasideFileUpload Post /v1/lookaside
ProjectServiceApi SetProjectCredentials Post /v1/projects/{projectId}/credentials
ProjectServiceApi SyncCatalog Post /v1/projects/{projectId}/catalogsync
ProjectServiceApi UpdateProject Put /v1/projects/{projectId}
SearchServiceApi Search Post /v1/search
TaskServiceApi CancelTask Post /v1/projects/{projectId}/tasks/{id}/cancel CancelTask cancels a task with the given ID. Only parent tasks can be cancelled and if they're in the PENDING or RUNNING state.
TaskServiceApi GetTask Get /v1/projects/{projectId}/tasks/{id} GetTask returns a specific task with the given ID
TaskServiceApi ListTasks Get /v1/projects/{projectId}/tasks ListTasks returns a list of tasks from all projects List mode won't return task responses. The reason being responses being able to reach huge sizes. To get the response for a specific task, you can use GetTask, either on the specific subtask or the parent task.
TaskServiceApi StreamTaskLogs Get /v1/projects/{projectId}/tasks/{id}/logs StreamTaskLogs streams the logs of a specific task with the given ID

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