peridot/vendor/openapi.peridot.resf.org/peridotopenapi/README.md

212 lines
13 KiB
Markdown
Raw Normal View History

# 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](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) 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:
```shell
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:
```golang
import sw "./peridotopenapi"
```
To use a proxy, set the environment variable `HTTP_PROXY`:
```golang
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`.
```golang
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`.
```golang
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**](docs/BuildServiceApi.md#getbuild) | **Get** /v1/projects/{projectId}/builds/{buildId} | GetBuild returns a build by its id
*BuildServiceApi* | [**GetBuildBatch**](docs/BuildServiceApi.md#getbuildbatch) | **Get** /v1/projects/{projectId}/build_batches/{buildBatchId} | GetBuildBatch returns a build batch by its id
*BuildServiceApi* | [**ListBuildBatches**](docs/BuildServiceApi.md#listbuildbatches) | **Get** /v1/projects/{projectId}/build_batches | ListBuildBatches returns all build batches
*BuildServiceApi* | [**ListBuilds**](docs/BuildServiceApi.md#listbuilds) | **Get** /v1/projects/{projectId}/builds | ListBuilds returns all builds filtered through given filters
*BuildServiceApi* | [**RpmImport**](docs/BuildServiceApi.md#rpmimport) | **Post** /v1/projects/{projectId}/builds/rpm-import | RpmImport imports rpm files into a project (packaged into tar format)
*BuildServiceApi* | [**RpmLookasideBatchImport**](docs/BuildServiceApi.md#rpmlookasidebatchimport) | **Post** /v1/projects/{projectId}/builds/rpm-lookaside-batch-import | RpmLookasideBatchImport imports rpm files into a project (stored in Lookaside)
*BuildServiceApi* | [**SubmitBuild**](docs/BuildServiceApi.md#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**](docs/BuildServiceApi.md#submitbuildbatch) | **Post** /v1/projects/{projectId}/build_batches | SubmitBuildBatch submits a batch of builds.
*ImportServiceApi* | [**GetImport**](docs/ImportServiceApi.md#getimport) | **Get** /v1/projects/{projectId}/imports/{importId} | GetImport gets an import by ID.
*ImportServiceApi* | [**GetImportBatch**](docs/ImportServiceApi.md#getimportbatch) | **Get** /v1/projects/{projectId}/import_batches/{importBatchId} | GetImportBatch gets an import batch by ID.
*ImportServiceApi* | [**ImportBatchRetryFailed**](docs/ImportServiceApi.md#importbatchretryfailed) | **Post** /v1/projects/{projectId}/import_batches/{importBatchId}/retry_failed | ImportBatchRetryFailed retries failed imports in a batch.
*ImportServiceApi* | [**ImportPackage**](docs/ImportServiceApi.md#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**](docs/ImportServiceApi.md#importpackagebatch) | **Post** /v1/projects/{projectId}/import_batches | ImportPackageBatch imports a batch of packages scoped to a project
*ImportServiceApi* | [**ListImportBatches**](docs/ImportServiceApi.md#listimportbatches) | **Get** /v1/projects/{projectId}/import_batches | ListImportBatches lists all import batches for a project.
*ImportServiceApi* | [**ListImports**](docs/ImportServiceApi.md#listimports) | **Get** /v1/projects/{projectId}/imports | ListImports lists all imports for a project.
*PackageServiceApi* | [**GetPackage**](docs/PackageServiceApi.md#getpackage) | **Get** /v1/projects/{projectId}/packages/{field}/{value} | GetPackage returns a package by its id or name
*PackageServiceApi* | [**ListPackages**](docs/PackageServiceApi.md#listpackages) | **Get** /v1/projects/{projectId}/packages | ListPackages returns all packages with filters applied
2023-02-17 19:00:41 +00:00
*ProjectServiceApi* | [**CloneSwap**](docs/ProjectServiceApi.md#cloneswap) | **Post** /v1/projects/{targetProjectId}/cloneswap |
*ProjectServiceApi* | [**CreateHashedRepositories**](docs/ProjectServiceApi.md#createhashedrepositories) | **Post** /v1/projects/{projectId}/repositories/hashed |
*ProjectServiceApi* | [**CreateProject**](docs/ProjectServiceApi.md#createproject) | **Post** /v1/projects |
2022-10-30 01:59:25 +00:00
*ProjectServiceApi* | [**DeleteExternalRepository**](docs/ProjectServiceApi.md#deleteexternalrepository) | **Delete** /v1/projects/{projectId}/external_repositories/{id} |
*ProjectServiceApi* | [**GetProject**](docs/ProjectServiceApi.md#getproject) | **Get** /v1/projects/{id} |
*ProjectServiceApi* | [**GetProjectCredentials**](docs/ProjectServiceApi.md#getprojectcredentials) | **Get** /v1/projects/{projectId}/credentials |
*ProjectServiceApi* | [**GetRepository**](docs/ProjectServiceApi.md#getrepository) | **Get** /v1/projects/{projectId}/repositories/{id} |
2022-10-30 01:59:25 +00:00
*ProjectServiceApi* | [**ListExternalRepositories**](docs/ProjectServiceApi.md#listexternalrepositories) | **Get** /v1/projects/{projectId}/external_repositories |
*ProjectServiceApi* | [**ListProjects**](docs/ProjectServiceApi.md#listprojects) | **Get** /v1/projects |
*ProjectServiceApi* | [**ListRepositories**](docs/ProjectServiceApi.md#listrepositories) | **Get** /v1/projects/{projectId}/repositories |
*ProjectServiceApi* | [**LookasideFileUpload**](docs/ProjectServiceApi.md#lookasidefileupload) | **Post** /v1/lookaside |
*ProjectServiceApi* | [**SetProjectCredentials**](docs/ProjectServiceApi.md#setprojectcredentials) | **Post** /v1/projects/{projectId}/credentials |
*ProjectServiceApi* | [**SyncCatalog**](docs/ProjectServiceApi.md#synccatalog) | **Post** /v1/projects/{projectId}/catalogsync |
*ProjectServiceApi* | [**UpdateProject**](docs/ProjectServiceApi.md#updateproject) | **Put** /v1/projects/{projectId} |
*SearchServiceApi* | [**Search**](docs/SearchServiceApi.md#search) | **Post** /v1/search |
*TaskServiceApi* | [**CancelTask**](docs/TaskServiceApi.md#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**](docs/TaskServiceApi.md#gettask) | **Get** /v1/projects/{projectId}/tasks/{id} | GetTask returns a specific task with the given ID
*TaskServiceApi* | [**ListTasks**](docs/TaskServiceApi.md#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**](docs/TaskServiceApi.md#streamtasklogs) | **Get** /v1/projects/{projectId}/tasks/{id}/logs | StreamTaskLogs streams the logs of a specific task with the given ID
## Documentation For Models
- [ApiHttpBody](docs/ApiHttpBody.md)
- [BuildServiceRpmImportBody](docs/BuildServiceRpmImportBody.md)
- [BuildServiceRpmLookasideBatchImportBody](docs/BuildServiceRpmLookasideBatchImportBody.md)
- [BuildServiceSubmitBuildBatchBody](docs/BuildServiceSubmitBuildBatchBody.md)
- [BuildServiceSubmitBuildBody](docs/BuildServiceSubmitBuildBody.md)
- [ImportServiceImportPackageBatchBody](docs/ImportServiceImportPackageBatchBody.md)
- [ImportServiceImportPackageBody](docs/ImportServiceImportPackageBody.md)
- [ProjectServiceCloneSwapBody](docs/ProjectServiceCloneSwapBody.md)
- [ProjectServiceCreateHashedRepositoriesBody](docs/ProjectServiceCreateHashedRepositoriesBody.md)
- [ProjectServiceSetProjectCredentialsBody](docs/ProjectServiceSetProjectCredentialsBody.md)
- [ProjectServiceSyncCatalogBody](docs/ProjectServiceSyncCatalogBody.md)
- [ProjectServiceUpdateProjectBody](docs/ProjectServiceUpdateProjectBody.md)
- [ProtobufAny](docs/ProtobufAny.md)
- [RpcStatus](docs/RpcStatus.md)
- [StreamResultOfV1SearchResponse](docs/StreamResultOfV1SearchResponse.md)
- [V1AsyncTask](docs/V1AsyncTask.md)
- [V1BatchFilter](docs/V1BatchFilter.md)
- [V1Build](docs/V1Build.md)
- [V1BuildBatch](docs/V1BuildBatch.md)
- [V1BuildFilters](docs/V1BuildFilters.md)
- [V1CreateProjectRequest](docs/V1CreateProjectRequest.md)
- [V1CreateProjectResponse](docs/V1CreateProjectResponse.md)
2022-10-30 01:59:25 +00:00
- [V1ExternalRepository](docs/V1ExternalRepository.md)
- [V1GetBuildBatchResponse](docs/V1GetBuildBatchResponse.md)
- [V1GetBuildResponse](docs/V1GetBuildResponse.md)
- [V1GetImportBatchResponse](docs/V1GetImportBatchResponse.md)
- [V1GetImportResponse](docs/V1GetImportResponse.md)
- [V1GetPackageResponse](docs/V1GetPackageResponse.md)
- [V1GetProjectCredentialsResponse](docs/V1GetProjectCredentialsResponse.md)
- [V1GetProjectResponse](docs/V1GetProjectResponse.md)
- [V1GetRepositoryResponse](docs/V1GetRepositoryResponse.md)
- [V1GetTaskResponse](docs/V1GetTaskResponse.md)
- [V1Import](docs/V1Import.md)
- [V1ImportBatch](docs/V1ImportBatch.md)
- [V1ImportBatchRetryFailedResponse](docs/V1ImportBatchRetryFailedResponse.md)
- [V1ImportPackageBatchResponse](docs/V1ImportPackageBatchResponse.md)
- [V1ImportPackageRequest](docs/V1ImportPackageRequest.md)
- [V1ImportRevision](docs/V1ImportRevision.md)
- [V1ListBuildBatchesResponse](docs/V1ListBuildBatchesResponse.md)
- [V1ListBuildsResponse](docs/V1ListBuildsResponse.md)
2022-10-30 01:59:25 +00:00
- [V1ListExternalRepositoriesResponse](docs/V1ListExternalRepositoriesResponse.md)
- [V1ListImportBatchesResponse](docs/V1ListImportBatchesResponse.md)
- [V1ListImportsResponse](docs/V1ListImportsResponse.md)
- [V1ListPackagesResponse](docs/V1ListPackagesResponse.md)
- [V1ListProjectsResponse](docs/V1ListProjectsResponse.md)
- [V1ListRepositoriesResponse](docs/V1ListRepositoriesResponse.md)
- [V1ListTasksResponse](docs/V1ListTasksResponse.md)
2024-10-16 11:26:54 +00:00
- [V1LookasideFileUploadRequest](docs/V1LookasideFileUploadRequest.md)
- [V1LookasideFileUploadResponse](docs/V1LookasideFileUploadResponse.md)
- [V1Package](docs/V1Package.md)
- [V1PackageFilters](docs/V1PackageFilters.md)
- [V1PackageType](docs/V1PackageType.md)
- [V1Project](docs/V1Project.md)
- [V1Repository](docs/V1Repository.md)
- [V1SearchRequest](docs/V1SearchRequest.md)
- [V1SearchResponse](docs/V1SearchResponse.md)
- [V1SetProjectCredentialsResponse](docs/V1SetProjectCredentialsResponse.md)
- [V1SubmitBuildBatchResponse](docs/V1SubmitBuildBatchResponse.md)
- [V1SubmitBuildRequest](docs/V1SubmitBuildRequest.md)
- [V1Subtask](docs/V1Subtask.md)
- [V1TaskStatus](docs/V1TaskStatus.md)
- [V1TaskType](docs/V1TaskType.md)
- [V1UpdateProjectResponse](docs/V1UpdateProjectResponse.md)
- [V1VersionRelease](docs/V1VersionRelease.md)
## 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