ad0f7a5305
Upgrade to Go 1.20.5, Hydra v2 SDK, rules-go v0.44.2 (with proper resolves), protobuf v25.3 and mass upgrade of Go dependencies. |
||
---|---|---|
.. | ||
.gitignore | ||
.openapi-generator-ignore | ||
.travis.yml | ||
api_build_service.go | ||
api_import_service.go | ||
api_package_service.go | ||
api_project_service.go | ||
api_search_service.go | ||
api_task_service.go | ||
BUILD.bazel | ||
client.go | ||
configuration.go | ||
git_push.sh | ||
model_api_http_body.go | ||
model_build_service_rpm_import_body.go | ||
model_build_service_rpm_lookaside_batch_import_body.go | ||
model_build_service_submit_build_batch_body.go | ||
model_build_service_submit_build_body.go | ||
model_import_service_import_package_batch_body.go | ||
model_import_service_import_package_body.go | ||
model_project_service_clone_swap_body.go | ||
model_project_service_create_hashed_repositories_body.go | ||
model_project_service_set_project_credentials_body.go | ||
model_project_service_sync_catalog_body.go | ||
model_project_service_update_project_body.go | ||
model_protobuf_any.go | ||
model_rpc_status.go | ||
model_stream_result_of_v1_search_response.go | ||
model_v1_async_task.go | ||
model_v1_batch_filter.go | ||
model_v1_build_batch.go | ||
model_v1_build_filters.go | ||
model_v1_build.go | ||
model_v1_create_project_request.go | ||
model_v1_create_project_response.go | ||
model_v1_external_repository.go | ||
model_v1_get_build_batch_response.go | ||
model_v1_get_build_response.go | ||
model_v1_get_import_batch_response.go | ||
model_v1_get_import_response.go | ||
model_v1_get_package_response.go | ||
model_v1_get_project_credentials_response.go | ||
model_v1_get_project_response.go | ||
model_v1_get_repository_response.go | ||
model_v1_get_task_response.go | ||
model_v1_import_batch_retry_failed_response.go | ||
model_v1_import_batch.go | ||
model_v1_import_package_batch_response.go | ||
model_v1_import_package_request.go | ||
model_v1_import_revision.go | ||
model_v1_import.go | ||
model_v1_list_build_batches_response.go | ||
model_v1_list_builds_response.go | ||
model_v1_list_external_repositories_response.go | ||
model_v1_list_import_batches_response.go | ||
model_v1_list_imports_response.go | ||
model_v1_list_packages_response.go | ||
model_v1_list_projects_response.go | ||
model_v1_list_repositories_response.go | ||
model_v1_list_tasks_response.go | ||
model_v1_lookaside_file_upload_request.go | ||
model_v1_lookaside_file_upload_response.go | ||
model_v1_package_filters.go | ||
model_v1_package_type.go | ||
model_v1_package.go | ||
model_v1_project.go | ||
model_v1_repository.go | ||
model_v1_search_request.go | ||
model_v1_search_response.go | ||
model_v1_set_project_credentials_response.go | ||
model_v1_submit_build_batch_response.go | ||
model_v1_submit_build_request.go | ||
model_v1_subtask.go | ||
model_v1_task_status.go | ||
model_v1_task_type.go | ||
model_v1_update_project_response.go | ||
model_v1_version_release.go | ||
README.md | ||
response.go | ||
utils.go |
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 | CloneSwap | Post /v1/projects/{targetProjectId}/cloneswap | |
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
- ApiHttpBody
- BuildServiceRpmImportBody
- BuildServiceRpmLookasideBatchImportBody
- BuildServiceSubmitBuildBatchBody
- BuildServiceSubmitBuildBody
- ImportServiceImportPackageBatchBody
- ImportServiceImportPackageBody
- ProjectServiceCloneSwapBody
- ProjectServiceCreateHashedRepositoriesBody
- ProjectServiceSetProjectCredentialsBody
- ProjectServiceSyncCatalogBody
- ProjectServiceUpdateProjectBody
- ProtobufAny
- RpcStatus
- StreamResultOfV1SearchResponse
- V1AsyncTask
- V1BatchFilter
- V1Build
- V1BuildBatch
- V1BuildFilters
- V1CreateProjectRequest
- V1CreateProjectResponse
- V1ExternalRepository
- V1GetBuildBatchResponse
- V1GetBuildResponse
- V1GetImportBatchResponse
- V1GetImportResponse
- V1GetPackageResponse
- V1GetProjectCredentialsResponse
- V1GetProjectResponse
- V1GetRepositoryResponse
- V1GetTaskResponse
- V1Import
- V1ImportBatch
- V1ImportBatchRetryFailedResponse
- V1ImportPackageBatchResponse
- V1ImportPackageRequest
- V1ImportRevision
- V1ListBuildBatchesResponse
- V1ListBuildsResponse
- V1ListExternalRepositoriesResponse
- V1ListImportBatchesResponse
- V1ListImportsResponse
- V1ListPackagesResponse
- V1ListProjectsResponse
- V1ListRepositoriesResponse
- V1ListTasksResponse
- V1LookasideFileUploadRequest
- V1LookasideFileUploadResponse
- V1Package
- V1PackageFilters
- V1PackageType
- V1Project
- V1Repository
- V1SearchRequest
- V1SearchResponse
- V1SetProjectCredentialsResponse
- V1SubmitBuildBatchResponse
- V1SubmitBuildRequest
- V1Subtask
- V1TaskStatus
- V1TaskType
- V1UpdateProjectResponse
- V1VersionRelease
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