last demo import - cleaned
This commit is contained in:
parent
0ab5dd5e38
commit
f3c3c67e2c
44
Dockerfile
Normal file
44
Dockerfile
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
FROM golang as builder
|
||||||
|
|
||||||
|
LABEL maintainer="Valentin KIVACHUK BURDA"
|
||||||
|
|
||||||
|
ENV DOCKER_ENVIRONMENT=true
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
|
ENV GOOS=linux
|
||||||
|
ENV GO111MODULE=on
|
||||||
|
|
||||||
|
EXPOSE 49618
|
||||||
|
|
||||||
|
WORKDIR /go/src/oc-search
|
||||||
|
|
||||||
|
#######################################################
|
||||||
|
RUN go get github.com/beego/bee/v2
|
||||||
|
|
||||||
|
COPY go.mod .
|
||||||
|
COPY go.sum .
|
||||||
|
RUN go mod download -x
|
||||||
|
|
||||||
|
# COPY . .
|
||||||
|
COPY main.go go.mod go.sum ./
|
||||||
|
|
||||||
|
COPY controllers controllers
|
||||||
|
COPY models models
|
||||||
|
COPY routers routers
|
||||||
|
COPY api-client api-client
|
||||||
|
COPY conf conf
|
||||||
|
COPY static static
|
||||||
|
COPY views views
|
||||||
|
COPY scripts scripts
|
||||||
|
|
||||||
|
# FROM golang
|
||||||
|
|
||||||
|
# WORKDIR /go/src/oc-catalog
|
||||||
|
|
||||||
|
# COPY --from=builder /go/src/oc-catalog .
|
||||||
|
|
||||||
|
ENV DOCKER_ENVIRONMENT=true
|
||||||
|
|
||||||
|
RUN go build .
|
||||||
|
|
||||||
|
|
||||||
|
CMD [ "bee", "run" ]
|
@ -1,2 +1,5 @@
|
|||||||
# oc-search
|
# OC Search
|
||||||
|
|
||||||
|
Regenerate Swagger client with:
|
||||||
|
|
||||||
|
`./scripts/generate_client.sh`
|
24
api-client/oc-catalog/.gitignore
vendored
Normal file
24
api-client/oc-catalog/.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Folders
|
||||||
|
_obj
|
||||||
|
_test
|
||||||
|
|
||||||
|
# Architecture specific extensions/prefixes
|
||||||
|
*.[568vq]
|
||||||
|
[568vq].out
|
||||||
|
|
||||||
|
*.cgo1.go
|
||||||
|
*.cgo2.c
|
||||||
|
_cgo_defun.c
|
||||||
|
_cgo_gotypes.go
|
||||||
|
_cgo_export.*
|
||||||
|
|
||||||
|
_testmain.go
|
||||||
|
|
||||||
|
*.exe
|
||||||
|
*.test
|
||||||
|
*.prof
|
23
api-client/oc-catalog/.swagger-codegen-ignore
Normal file
23
api-client/oc-catalog/.swagger-codegen-ignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Swagger Codegen Ignore
|
||||||
|
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
1
api-client/oc-catalog/.swagger-codegen/VERSION
Normal file
1
api-client/oc-catalog/.swagger-codegen/VERSION
Normal file
@ -0,0 +1 @@
|
|||||||
|
2.4.18
|
8
api-client/oc-catalog/.travis.yml
Normal file
8
api-client/oc-catalog/.travis.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
language: go
|
||||||
|
|
||||||
|
install:
|
||||||
|
- go get -d -v .
|
||||||
|
|
||||||
|
script:
|
||||||
|
- go build -v ./
|
||||||
|
|
100
api-client/oc-catalog/README.md
Normal file
100
api-client/oc-catalog/README.md
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
# Go API client for swagger
|
||||||
|
|
||||||
|
Backend of the oc-search project
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build package: io.swagger.codegen.languages.GoClientCodegen
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Put the package under your project folder and add the following in import:
|
||||||
|
```golang
|
||||||
|
import "./swagger"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*ComputingApi* | [**ComputingControllerAddComputing**](docs/ComputingApi.md#computingcontrolleraddcomputing) | **Post** /computing/ |
|
||||||
|
*ComputingApi* | [**ComputingControllerGetComputingByID**](docs/ComputingApi.md#computingcontrollergetcomputingbyid) | **Get** /computing/{ID} |
|
||||||
|
*ComputingApi* | [**ComputingControllerGetMultipleComputingByIDs**](docs/ComputingApi.md#computingcontrollergetmultiplecomputingbyids) | **Get** /computing/multi/{IDs} |
|
||||||
|
*DataApi* | [**DataControllerCreateData**](docs/DataApi.md#datacontrollercreatedata) | **Post** /data/ |
|
||||||
|
*DataApi* | [**DataControllerGetDataByID**](docs/DataApi.md#datacontrollergetdatabyid) | **Get** /data/{ID} |
|
||||||
|
*DataApi* | [**DataControllerGetMultipleDataByIDs**](docs/DataApi.md#datacontrollergetmultipledatabyids) | **Get** /data/multi/{IDs} |
|
||||||
|
*DatacenterApi* | [**DatacenterControllerCreateDatacenter**](docs/DatacenterApi.md#datacentercontrollercreatedatacenter) | **Post** /datacenter/ |
|
||||||
|
*DatacenterApi* | [**DatacenterControllerGetMultipleDatacentersByIDs**](docs/DatacenterApi.md#datacentercontrollergetmultipledatacentersbyids) | **Get** /datacenter/multi/{IDs} |
|
||||||
|
*DatacenterApi* | [**DatacenterControllerGetOneDatacenter**](docs/DatacenterApi.md#datacentercontrollergetonedatacenter) | **Get** /datacenter/{ID} |
|
||||||
|
*ScheduleApi* | [**ScheduleControllerCheckIfScheduleCanBeCreatedInThisDC**](docs/ScheduleApi.md#schedulecontrollercheckifschedulecanbecreatedinthisdc) | **Post** /schedule/check |
|
||||||
|
*ScheduleApi* | [**ScheduleControllerCreateSchedule**](docs/ScheduleApi.md#schedulecontrollercreateschedule) | **Post** /schedule/book |
|
||||||
|
*ScheduleApi* | [**ScheduleControllerGetNextSchedule**](docs/ScheduleApi.md#schedulecontrollergetnextschedule) | **Get** /schedule/next |
|
||||||
|
*ScheduleApi* | [**ScheduleControllerGetPreviousSchedule**](docs/ScheduleApi.md#schedulecontrollergetpreviousschedule) | **Get** /schedule/previous |
|
||||||
|
*ScheduleApi* | [**ScheduleControllerGetSchedules**](docs/ScheduleApi.md#schedulecontrollergetschedules) | **Get** /schedule/ |
|
||||||
|
*SearchApi* | [**SearchControllerSearchByWord**](docs/SearchApi.md#searchcontrollersearchbyword) | **Get** /search/byWord |
|
||||||
|
*StorageApi* | [**StorageControllerCreateStorage**](docs/StorageApi.md#storagecontrollercreatestorage) | **Post** /storage/ |
|
||||||
|
*StorageApi* | [**StorageControllerGet**](docs/StorageApi.md#storagecontrollerget) | **Get** /storage/{ID} |
|
||||||
|
*StorageApi* | [**StorageControllerGetMultipleStoragesByIDs**](docs/StorageApi.md#storagecontrollergetmultiplestoragesbyids) | **Get** /storage/multi/{IDs} |
|
||||||
|
*UserApi* | [**UserControllerLogin**](docs/UserApi.md#usercontrollerlogin) | **Get** /user/login |
|
||||||
|
*UserApi* | [**UserControllerLogout**](docs/UserApi.md#usercontrollerlogout) | **Get** /user/logout |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerAddNewObjectToAWorkflow**](docs/WorkflowApi.md#workflowcontrolleraddnewobjecttoaworkflow) | **Post** /workflow/{workflowName}/add |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerBookSchedule**](docs/WorkflowApi.md#workflowcontrollerbookschedule) | **Post** /workflow/{workflowName}/schedule/book |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerCheckSchedule**](docs/WorkflowApi.md#workflowcontrollercheckschedule) | **Get** /workflow/{workflowName}/schedule/check |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerCreateANewWorkflow**](docs/WorkflowApi.md#workflowcontrollercreateanewworkflow) | **Post** /workflow/ |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerCreateARealtionshipBetweenTwoRobjects**](docs/WorkflowApi.md#workflowcontrollercreatearealtionshipbetweentworobjects) | **Post** /workflow/{workflowName}/link |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerGetMxGraphLastStatus**](docs/WorkflowApi.md#workflowcontrollergetmxgraphlaststatus) | **Get** /workflow/{workflowName}/mxGraphParser |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerGetSchedule**](docs/WorkflowApi.md#workflowcontrollergetschedule) | **Get** /workflow/{workflowName}/schedule |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerGetWorkflow**](docs/WorkflowApi.md#workflowcontrollergetworkflow) | **Get** /workflow/{workflowName} |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerListWorkflows**](docs/WorkflowApi.md#workflowcontrollerlistworkflows) | **Get** /workflow/ |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerParseMxGraph**](docs/WorkflowApi.md#workflowcontrollerparsemxgraph) | **Post** /workflow/{workflowName}/mxGraphParser |
|
||||||
|
*WorkflowApi* | [**WorkflowControllerSetSchedule**](docs/WorkflowApi.md#workflowcontrollersetschedule) | **Put** /workflow/{workflowName}/schedule |
|
||||||
|
*WorkspaceApi* | [**WorkspaceControllerAddModelToWorkspace**](docs/WorkspaceApi.md#workspacecontrolleraddmodeltoworkspace) | **Post** /workspace/ |
|
||||||
|
*WorkspaceApi* | [**WorkspaceControllerDeleteElementFromUserWorkspace**](docs/WorkspaceApi.md#workspacecontrollerdeleteelementfromuserworkspace) | **Delete** /workspace/ |
|
||||||
|
*WorkspaceApi* | [**WorkspaceControllerGetFullWorkspace**](docs/WorkspaceApi.md#workspacecontrollergetfullworkspace) | **Get** /workspace/list_model |
|
||||||
|
*WorkspaceApi* | [**WorkspaceControllerGetWorkspace**](docs/WorkspaceApi.md#workspacecontrollergetworkspace) | **Get** /workspace/list |
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [ModelsComputingModel](docs/ModelsComputingModel.md)
|
||||||
|
- [ModelsComputingNewModel](docs/ModelsComputingNewModel.md)
|
||||||
|
- [ModelsComputingObject](docs/ModelsComputingObject.md)
|
||||||
|
- [ModelsDCstatus](docs/ModelsDCstatus.md)
|
||||||
|
- [ModelsDataModel](docs/ModelsDataModel.md)
|
||||||
|
- [ModelsDataNewModel](docs/ModelsDataNewModel.md)
|
||||||
|
- [ModelsDataObject](docs/ModelsDataObject.md)
|
||||||
|
- [ModelsDatacenterCpuModel](docs/ModelsDatacenterCpuModel.md)
|
||||||
|
- [ModelsDatacenterGpuModel](docs/ModelsDatacenterGpuModel.md)
|
||||||
|
- [ModelsDatacenterMemoryModel](docs/ModelsDatacenterMemoryModel.md)
|
||||||
|
- [ModelsDatacenterModel](docs/ModelsDatacenterModel.md)
|
||||||
|
- [ModelsDatacenterNewModel](docs/ModelsDatacenterNewModel.md)
|
||||||
|
- [ModelsDatacenterObject](docs/ModelsDatacenterObject.md)
|
||||||
|
- [ModelsExecutionRequirementsModel](docs/ModelsExecutionRequirementsModel.md)
|
||||||
|
- [ModelsRepositoryModel](docs/ModelsRepositoryModel.md)
|
||||||
|
- [ModelsScheduleDb](docs/ModelsScheduleDb.md)
|
||||||
|
- [ModelsScheduleInfo](docs/ModelsScheduleInfo.md)
|
||||||
|
- [ModelsScheduleTime](docs/ModelsScheduleTime.md)
|
||||||
|
- [ModelsSearchResult](docs/ModelsSearchResult.md)
|
||||||
|
- [ModelsStorageModel](docs/ModelsStorageModel.md)
|
||||||
|
- [ModelsStorageNewModel](docs/ModelsStorageNewModel.md)
|
||||||
|
- [ModelsStorageObject](docs/ModelsStorageObject.md)
|
||||||
|
- [ModelsWorkflow](docs/ModelsWorkflow.md)
|
||||||
|
- [ModelsWorkflowSchedule](docs/ModelsWorkflowSchedule.md)
|
||||||
|
- [ModelsWorkspace](docs/ModelsWorkspace.md)
|
||||||
|
- [ModelsWorkspaceModel](docs/ModelsWorkspaceModel.md)
|
||||||
|
- [PrimitiveObjectId](docs/PrimitiveObjectId.md)
|
||||||
|
- [TimeTime](docs/TimeTime.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
Endpoints do not require authorization.
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
valentin.kivachuk@irt-saintexupery.com
|
||||||
|
|
2041
api-client/oc-catalog/api/swagger.yaml
Normal file
2041
api-client/oc-catalog/api/swagger.yaml
Normal file
File diff suppressed because it is too large
Load Diff
275
api-client/oc-catalog/api_computing.go
Normal file
275
api-client/oc-catalog/api_computing.go
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputingApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
ComputingApiService
|
||||||
|
Submit a computing object
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param body The object content
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *ComputingApiService) ComputingControllerAddComputing(ctx context.Context, body ModelsComputingNewModel) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/computing/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &body
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ComputingApiService
|
||||||
|
Find a computing resource based on ID
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iD The ID of the resource
|
||||||
|
|
||||||
|
@return ModelsComputingModel
|
||||||
|
*/
|
||||||
|
func (a *ComputingApiService) ComputingControllerGetComputingByID(ctx context.Context, iD string) (ModelsComputingModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsComputingModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/computing/{ID}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"ID"+"}", fmt.Sprintf("%v", iD), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsComputingModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ComputingApiService
|
||||||
|
Return Computing objects if found in the DB. Not found IDs will be ignored
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iDs List of computing IDs
|
||||||
|
|
||||||
|
@return []ModelsComputingModel
|
||||||
|
*/
|
||||||
|
func (a *ComputingApiService) ComputingControllerGetMultipleComputingByIDs(ctx context.Context, iDs []string) ([]ModelsComputingModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsComputingModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/computing/multi/{IDs}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"IDs"+"}", fmt.Sprintf("%v", iDs), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsComputingModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
275
api-client/oc-catalog/api_data.go
Normal file
275
api-client/oc-catalog/api_data.go
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type DataApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
DataApiService
|
||||||
|
Submit data object
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param body The object content
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *DataApiService) DataControllerCreateData(ctx context.Context, body ModelsDataNewModel) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/data/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &body
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DataApiService
|
||||||
|
Find rType data based on ID
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iD The ID of the data resource
|
||||||
|
|
||||||
|
@return ModelsDataModel
|
||||||
|
*/
|
||||||
|
func (a *DataApiService) DataControllerGetDataByID(ctx context.Context, iD string) (ModelsDataModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsDataModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/data/{ID}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"ID"+"}", fmt.Sprintf("%v", iD), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsDataModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DataApiService
|
||||||
|
Return Data object if found in the DB. Not found IDs will be ignored
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iDs List of data IDs
|
||||||
|
|
||||||
|
@return []ModelsDataModel
|
||||||
|
*/
|
||||||
|
func (a *DataApiService) DataControllerGetMultipleDataByIDs(ctx context.Context, iDs []string) ([]ModelsDataModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsDataModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/data/multi/{IDs}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"IDs"+"}", fmt.Sprintf("%v", iDs), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsDataModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
275
api-client/oc-catalog/api_datacenter.go
Normal file
275
api-client/oc-catalog/api_datacenter.go
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type DatacenterApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
DatacenterApiService
|
||||||
|
submit Datacenter object
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param body The object content
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *DatacenterApiService) DatacenterControllerCreateDatacenter(ctx context.Context, body ModelsDatacenterNewModel) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/datacenter/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &body
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DatacenterApiService
|
||||||
|
Return Datacenter objects if found in the DB. Not found IDs will be ignored
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iDs List of datacenter IDs
|
||||||
|
|
||||||
|
@return []ModelsComputingModel
|
||||||
|
*/
|
||||||
|
func (a *DatacenterApiService) DatacenterControllerGetMultipleDatacentersByIDs(ctx context.Context, iDs []string) ([]ModelsComputingModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsComputingModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/datacenter/multi/{IDs}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"IDs"+"}", fmt.Sprintf("%v", iDs), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsComputingModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DatacenterApiService
|
||||||
|
find datacenter by ID
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iD the ID you want to get
|
||||||
|
|
||||||
|
@return ModelsDatacenterModel
|
||||||
|
*/
|
||||||
|
func (a *DatacenterApiService) DatacenterControllerGetOneDatacenter(ctx context.Context, iD string) (ModelsDatacenterModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsDatacenterModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/datacenter/{ID}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"ID"+"}", fmt.Sprintf("%v", iD), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsDatacenterModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
471
api-client/oc-catalog/api_schedule.go
Normal file
471
api-client/oc-catalog/api_schedule.go
Normal file
@ -0,0 +1,471 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type ScheduleApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
ScheduleApiService
|
||||||
|
Check for availability of this DC
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param cron Cron syntax
|
||||||
|
* @param duration Duration in seconds
|
||||||
|
* @param startDate RFC3339 time for startDate
|
||||||
|
* @param stopDate RFC3339 time for stopDate
|
||||||
|
* @param requirements The object content
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *ScheduleApiService) ScheduleControllerCheckIfScheduleCanBeCreatedInThisDC(ctx context.Context, cron string, duration int32, startDate interface{}, stopDate interface{}, requirements ModelsExecutionRequirementsModel) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/schedule/check"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("cron", parameterToString(cron, ""))
|
||||||
|
localVarQueryParams.Add("duration", parameterToString(duration, ""))
|
||||||
|
localVarQueryParams.Add("startDate", parameterToString(startDate, ""))
|
||||||
|
localVarQueryParams.Add("stopDate", parameterToString(stopDate, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &requirements
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ScheduleApiService
|
||||||
|
Create schedule for a workflow. It will return some future executions just as information
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param dcName Name of the node (oc-catalog) from where the workflow comes.
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
* @param cron Cron syntax with year. If no year is specified, will use the current
|
||||||
|
* @param duration Duration in seconds
|
||||||
|
* @param startDate RFC3339 time for startDate
|
||||||
|
* @param stopDate RFC3339 time for stopDate
|
||||||
|
* @param requirements The object content
|
||||||
|
|
||||||
|
@return ModelsScheduleInfo
|
||||||
|
*/
|
||||||
|
func (a *ScheduleApiService) ScheduleControllerCreateSchedule(ctx context.Context, dcName string, workflowName string, cron string, duration int32, startDate interface{}, stopDate interface{}, requirements ModelsExecutionRequirementsModel) (ModelsScheduleInfo, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsScheduleInfo
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/schedule/book"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("dcName", parameterToString(dcName, ""))
|
||||||
|
localVarQueryParams.Add("workflowName", parameterToString(workflowName, ""))
|
||||||
|
localVarQueryParams.Add("cron", parameterToString(cron, ""))
|
||||||
|
localVarQueryParams.Add("duration", parameterToString(duration, ""))
|
||||||
|
localVarQueryParams.Add("startDate", parameterToString(startDate, ""))
|
||||||
|
localVarQueryParams.Add("stopDate", parameterToString(stopDate, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &requirements
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsScheduleInfo
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ScheduleApiService
|
||||||
|
Give a date, get the next date where there are at least on schedule. If no hours specified, will assume 00:00
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param baseDate Base date
|
||||||
|
|
||||||
|
@return TimeTime
|
||||||
|
*/
|
||||||
|
func (a *ScheduleApiService) ScheduleControllerGetNextSchedule(ctx context.Context, baseDate interface{}) (TimeTime, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue TimeTime
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/schedule/next"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("baseDate", parameterToString(baseDate, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v TimeTime
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ScheduleApiService
|
||||||
|
Give a date, get the previous date where there are at least on schedule. If no hours specified, will assume 00:00
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param baseDate Base date
|
||||||
|
|
||||||
|
@return TimeTime
|
||||||
|
*/
|
||||||
|
func (a *ScheduleApiService) ScheduleControllerGetPreviousSchedule(ctx context.Context, baseDate interface{}) (TimeTime, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue TimeTime
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/schedule/previous"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("baseDate", parameterToString(baseDate, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v TimeTime
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ScheduleApiService
|
||||||
|
Get a list of next startDates schedules (inclusive). If timezone is not specified, will assume UTC
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param startDate Start date
|
||||||
|
* @param stopDate End date
|
||||||
|
|
||||||
|
@return []ModelsScheduleDb
|
||||||
|
*/
|
||||||
|
func (a *ScheduleApiService) ScheduleControllerGetSchedules(ctx context.Context, startDate interface{}, stopDate interface{}) ([]ModelsScheduleDb, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsScheduleDb
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/schedule/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("startDate", parameterToString(startDate, ""))
|
||||||
|
localVarQueryParams.Add("stopDate", parameterToString(stopDate, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsScheduleDb
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
115
api-client/oc-catalog/api_search.go
Normal file
115
api-client/oc-catalog/api_search.go
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type SearchApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
SearchApiService
|
||||||
|
find resources by word
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param word Word to search across all resources
|
||||||
|
|
||||||
|
@return ModelsSearchResult
|
||||||
|
*/
|
||||||
|
func (a *SearchApiService) SearchControllerSearchByWord(ctx context.Context, word string) (ModelsSearchResult, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsSearchResult
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/search/byWord"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("word", parameterToString(word, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsSearchResult
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
275
api-client/oc-catalog/api_storage.go
Normal file
275
api-client/oc-catalog/api_storage.go
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type StorageApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
StorageApiService
|
||||||
|
submit storage object
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param body The object content
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *StorageApiService) StorageControllerCreateStorage(ctx context.Context, body ModelsStorageNewModel) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/storage/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &body
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
StorageApiService
|
||||||
|
find storage by ID
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iD the ID you want to get
|
||||||
|
|
||||||
|
@return ModelsStorageModel
|
||||||
|
*/
|
||||||
|
func (a *StorageApiService) StorageControllerGet(ctx context.Context, iD string) (ModelsStorageModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsStorageModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/storage/{ID}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"ID"+"}", fmt.Sprintf("%v", iD), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsStorageModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
StorageApiService
|
||||||
|
Return Storage objects if found in the DB. Not found IDs will be ignored
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param iDs List of storage IDs
|
||||||
|
|
||||||
|
@return []ModelsComputingModel
|
||||||
|
*/
|
||||||
|
func (a *StorageApiService) StorageControllerGetMultipleStoragesByIDs(ctx context.Context, iDs []string) ([]ModelsComputingModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsComputingModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/storage/multi/{IDs}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"IDs"+"}", fmt.Sprintf("%v", iDs), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsComputingModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
170
api-client/oc-catalog/api_user.go
Normal file
170
api-client/oc-catalog/api_user.go
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
UserApiService
|
||||||
|
Logs user into the system
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param username The username for login
|
||||||
|
* @param password The password for login
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *UserApiService) UserControllerLogin(ctx context.Context, username string, password string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/user/login"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("username", parameterToString(username, ""))
|
||||||
|
localVarQueryParams.Add("password", parameterToString(password, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
UserApiService
|
||||||
|
Logs out current logged in user session
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *UserApiService) UserControllerLogout(ctx context.Context) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/user/logout"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
926
api-client/oc-catalog/api_workflow.go
Normal file
926
api-client/oc-catalog/api_workflow.go
Normal file
@ -0,0 +1,926 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
"github.com/antihax/optional"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type WorkflowApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Create a Rtype object from already added resources to the workspace
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName workflow Name
|
||||||
|
* @param rID rID of already existing item in Workspace
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerAddNewObjectToAWorkflow(ctx context.Context, workflowName string, rID string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/add"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("rID", parameterToString(rID, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Book a schedule in all DCs of the workflow. Must set a desired schedule first!
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
|
||||||
|
@return []ModelsDCstatus
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerBookSchedule(ctx context.Context, workflowName string) ([]ModelsDCstatus, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsDCstatus
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/schedule/book"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsDCstatus
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Check if we can schedule the project in other DCs. Must set a desired schedule first!
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
|
||||||
|
@return []ModelsDCstatus
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerCheckSchedule(ctx context.Context, workflowName string) ([]ModelsDCstatus, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue []ModelsDCstatus
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/schedule/check"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v []ModelsDCstatus
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Create a name for the new workflow
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Name of the workflow
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerCreateANewWorkflow(ctx context.Context, workflowName string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("workflowName", parameterToString(workflowName, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Create a Rtype object from already added resources to the workspace
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
* @param rObjIDsource Robject source. Usually Data
|
||||||
|
* @param isInput If the operation is for input (true) linkage or output (false)
|
||||||
|
* @param rObjIDtarger Robject where will be written the association
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerCreateARealtionshipBetweenTwoRobjects(ctx context.Context, workflowName string, rObjIDsource string, isInput bool, rObjIDtarger string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/link"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("rObjIDsource", parameterToString(rObjIDsource, ""))
|
||||||
|
localVarQueryParams.Add("isInput", parameterToString(isInput, ""))
|
||||||
|
localVarQueryParams.Add("rObjIDtarger", parameterToString(rObjIDtarger, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Obtain the last mxgraph XML status from the workflow
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerGetMxGraphLastStatus(ctx context.Context, workflowName string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/mxGraphParser"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Obtain the desired schedule of this workflow
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
|
||||||
|
@return ModelsScheduleTime
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerGetSchedule(ctx context.Context, workflowName string) (ModelsScheduleTime, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsScheduleTime
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/schedule"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsScheduleTime
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Get a workflow by name
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
|
||||||
|
@return ModelsWorkflow
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerGetWorkflow(ctx context.Context, workflowName string) (ModelsWorkflow, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsWorkflow
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsWorkflow
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
List available workflows
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerListWorkflows(ctx context.Context) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
If we use this aproach to transofrm mxgraph representation in our representation, we should not use other API calls for modify the project structure or we'll have inconsistencies.
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
* @param xmlData Xml representation of the workflow
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerParseMxGraph(ctx context.Context, workflowName string, xmlData string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/mxGraphParser"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
// body params
|
||||||
|
localVarPostBody = &xmlData
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkflowApiService
|
||||||
|
Set desired schedule by the user. No other effects a part of saving the user input
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param workflowName Workflow Name
|
||||||
|
* @param isService True: Service, False: Task
|
||||||
|
* @param startDate RFC3339 time for startDate
|
||||||
|
* @param stopDate RFC3339 time for stopDate
|
||||||
|
* @param optional nil or *WorkflowApiWorkflowControllerSetScheduleOpts - Optional Parameters:
|
||||||
|
* @param "Events" (optional.String) - List of events separated by comma
|
||||||
|
* @param "CronString" (optional.String) - Cron string
|
||||||
|
* @param "Duration" (optional.Int32) - Duration in seconds
|
||||||
|
|
||||||
|
@return ModelsScheduleInfo
|
||||||
|
*/
|
||||||
|
|
||||||
|
type WorkflowApiWorkflowControllerSetScheduleOpts struct {
|
||||||
|
Events optional.String
|
||||||
|
CronString optional.String
|
||||||
|
Duration optional.Int32
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *WorkflowApiService) WorkflowControllerSetSchedule(ctx context.Context, workflowName string, isService bool, startDate interface{}, stopDate interface{}, localVarOptionals *WorkflowApiWorkflowControllerSetScheduleOpts) (ModelsScheduleInfo, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Put")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsScheduleInfo
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workflow/{workflowName}/schedule"
|
||||||
|
localVarPath = strings.Replace(localVarPath, "{"+"workflowName"+"}", fmt.Sprintf("%v", workflowName), -1)
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("isService", parameterToString(isService, ""))
|
||||||
|
localVarQueryParams.Add("startDate", parameterToString(startDate, ""))
|
||||||
|
localVarQueryParams.Add("stopDate", parameterToString(stopDate, ""))
|
||||||
|
if localVarOptionals != nil && localVarOptionals.Events.IsSet() {
|
||||||
|
localVarQueryParams.Add("events", parameterToString(localVarOptionals.Events.Value(), ""))
|
||||||
|
}
|
||||||
|
if localVarOptionals != nil && localVarOptionals.CronString.IsSet() {
|
||||||
|
localVarQueryParams.Add("cronString", parameterToString(localVarOptionals.CronString.Value(), ""))
|
||||||
|
}
|
||||||
|
if localVarOptionals != nil && localVarOptionals.Duration.IsSet() {
|
||||||
|
localVarQueryParams.Add("duration", parameterToString(localVarOptionals.Duration.Value(), ""))
|
||||||
|
}
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsScheduleInfo
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
344
api-client/oc-catalog/api_workspace.go
Normal file
344
api-client/oc-catalog/api_workspace.go
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Linger please
|
||||||
|
var (
|
||||||
|
_ context.Context
|
||||||
|
)
|
||||||
|
|
||||||
|
type WorkspaceApiService service
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkspaceApiService
|
||||||
|
Insert a resource in the workspace
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param id ID of a resource
|
||||||
|
* @param rtype Type of resource
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkspaceApiService) WorkspaceControllerAddModelToWorkspace(ctx context.Context, id string, rtype string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Post")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workspace/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("id", parameterToString(id, ""))
|
||||||
|
localVarQueryParams.Add("rtype", parameterToString(rtype, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkspaceApiService
|
||||||
|
Remove a resource from the workspace
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
* @param id ID of a resource
|
||||||
|
* @param rtype Type of resource
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
func (a *WorkspaceApiService) WorkspaceControllerDeleteElementFromUserWorkspace(ctx context.Context, id string, rtype string) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Delete")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workspace/"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
localVarQueryParams.Add("id", parameterToString(id, ""))
|
||||||
|
localVarQueryParams.Add("rtype", parameterToString(rtype, ""))
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkspaceApiService
|
||||||
|
Get full workspace elements based on user_id token
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
|
||||||
|
@return ModelsWorkspaceModel
|
||||||
|
*/
|
||||||
|
func (a *WorkspaceApiService) WorkspaceControllerGetFullWorkspace(ctx context.Context) (ModelsWorkspaceModel, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsWorkspaceModel
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workspace/list_model"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsWorkspaceModel
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
WorkspaceApiService
|
||||||
|
Get workspace elements based on user_id token
|
||||||
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
|
||||||
|
@return ModelsWorkspace
|
||||||
|
*/
|
||||||
|
func (a *WorkspaceApiService) WorkspaceControllerGetWorkspace(ctx context.Context) (ModelsWorkspace, *http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHttpMethod = strings.ToUpper("Get")
|
||||||
|
localVarPostBody interface{}
|
||||||
|
localVarFileName string
|
||||||
|
localVarFileBytes []byte
|
||||||
|
localVarReturnValue ModelsWorkspace
|
||||||
|
)
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
localVarPath := a.client.cfg.BasePath + "/workspace/list"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||||
|
}
|
||||||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHttpResponse, err := a.client.callAPI(r)
|
||||||
|
if err != nil || localVarHttpResponse == nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
|
localVarHttpResponse.Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode < 300 {
|
||||||
|
// If we succeed, return the data, otherwise pass on to decode error.
|
||||||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
return localVarReturnValue, localVarHttpResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode >= 300 {
|
||||||
|
newErr := GenericSwaggerError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHttpResponse.Status,
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHttpResponse.StatusCode == 200 {
|
||||||
|
var v ModelsWorkspace
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = err.Error()
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
newErr.model = v
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarReturnValue, localVarHttpResponse, nil
|
||||||
|
}
|
||||||
|
|
499
api-client/oc-catalog/client.go
Normal file
499
api-client/oc-catalog/client.go
Normal file
@ -0,0 +1,499 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"encoding/xml"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"mime/multipart"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
|
"regexp"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"golang.org/x/oauth2"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)")
|
||||||
|
xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)")
|
||||||
|
)
|
||||||
|
|
||||||
|
// APIClient manages communication with the oc-catalog API API v1.0.0
|
||||||
|
// In most cases there should be only one, shared, APIClient.
|
||||||
|
type APIClient struct {
|
||||||
|
cfg *Configuration
|
||||||
|
common service // Reuse a single struct instead of allocating one for each service on the heap.
|
||||||
|
|
||||||
|
// API Services
|
||||||
|
|
||||||
|
ComputingApi *ComputingApiService
|
||||||
|
|
||||||
|
DataApi *DataApiService
|
||||||
|
|
||||||
|
DatacenterApi *DatacenterApiService
|
||||||
|
|
||||||
|
ScheduleApi *ScheduleApiService
|
||||||
|
|
||||||
|
SearchApi *SearchApiService
|
||||||
|
|
||||||
|
StorageApi *StorageApiService
|
||||||
|
|
||||||
|
UserApi *UserApiService
|
||||||
|
|
||||||
|
WorkflowApi *WorkflowApiService
|
||||||
|
|
||||||
|
WorkspaceApi *WorkspaceApiService
|
||||||
|
}
|
||||||
|
|
||||||
|
type service struct {
|
||||||
|
client *APIClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
|
||||||
|
// optionally a custom http.Client to allow for advanced features such as caching.
|
||||||
|
func NewAPIClient(cfg *Configuration) *APIClient {
|
||||||
|
if cfg.HTTPClient == nil {
|
||||||
|
cfg.HTTPClient = http.DefaultClient
|
||||||
|
}
|
||||||
|
|
||||||
|
c := &APIClient{}
|
||||||
|
c.cfg = cfg
|
||||||
|
c.common.client = c
|
||||||
|
|
||||||
|
// API Services
|
||||||
|
c.ComputingApi = (*ComputingApiService)(&c.common)
|
||||||
|
c.DataApi = (*DataApiService)(&c.common)
|
||||||
|
c.DatacenterApi = (*DatacenterApiService)(&c.common)
|
||||||
|
c.ScheduleApi = (*ScheduleApiService)(&c.common)
|
||||||
|
c.SearchApi = (*SearchApiService)(&c.common)
|
||||||
|
c.StorageApi = (*StorageApiService)(&c.common)
|
||||||
|
c.UserApi = (*UserApiService)(&c.common)
|
||||||
|
c.WorkflowApi = (*WorkflowApiService)(&c.common)
|
||||||
|
c.WorkspaceApi = (*WorkspaceApiService)(&c.common)
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
func atoi(in string) (int, error) {
|
||||||
|
return strconv.Atoi(in)
|
||||||
|
}
|
||||||
|
|
||||||
|
// selectHeaderContentType select a content type from the available list.
|
||||||
|
func selectHeaderContentType(contentTypes []string) string {
|
||||||
|
if len(contentTypes) == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
if contains(contentTypes, "application/json") {
|
||||||
|
return "application/json"
|
||||||
|
}
|
||||||
|
return contentTypes[0] // use the first content type specified in 'consumes'
|
||||||
|
}
|
||||||
|
|
||||||
|
// selectHeaderAccept join all accept types and return
|
||||||
|
func selectHeaderAccept(accepts []string) string {
|
||||||
|
if len(accepts) == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
if contains(accepts, "application/json") {
|
||||||
|
return "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.Join(accepts, ",")
|
||||||
|
}
|
||||||
|
|
||||||
|
// contains is a case insenstive match, finding needle in a haystack
|
||||||
|
func contains(haystack []string, needle string) bool {
|
||||||
|
for _, a := range haystack {
|
||||||
|
if strings.ToLower(a) == strings.ToLower(needle) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify optional parameters are of the correct type.
|
||||||
|
func typeCheckParameter(obj interface{}, expected string, name string) error {
|
||||||
|
// Make sure there is an object.
|
||||||
|
if obj == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the type is as expected.
|
||||||
|
if reflect.TypeOf(obj).String() != expected {
|
||||||
|
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
|
||||||
|
func parameterToString(obj interface{}, collectionFormat string) string {
|
||||||
|
var delimiter string
|
||||||
|
|
||||||
|
switch collectionFormat {
|
||||||
|
case "pipes":
|
||||||
|
delimiter = "|"
|
||||||
|
case "ssv":
|
||||||
|
delimiter = " "
|
||||||
|
case "tsv":
|
||||||
|
delimiter = "\t"
|
||||||
|
case "csv":
|
||||||
|
delimiter = ","
|
||||||
|
}
|
||||||
|
|
||||||
|
if reflect.TypeOf(obj).Kind() == reflect.Slice {
|
||||||
|
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("%v", obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
// callAPI do the request.
|
||||||
|
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
||||||
|
return c.cfg.HTTPClient.Do(request)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Change base path to allow switching to mocks
|
||||||
|
func (c *APIClient) ChangeBasePath(path string) {
|
||||||
|
c.cfg.BasePath = path
|
||||||
|
}
|
||||||
|
|
||||||
|
// prepareRequest build the request
|
||||||
|
func (c *APIClient) prepareRequest(
|
||||||
|
ctx context.Context,
|
||||||
|
path string, method string,
|
||||||
|
postBody interface{},
|
||||||
|
headerParams map[string]string,
|
||||||
|
queryParams url.Values,
|
||||||
|
formParams url.Values,
|
||||||
|
fileName string,
|
||||||
|
fileBytes []byte) (localVarRequest *http.Request, err error) {
|
||||||
|
|
||||||
|
var body *bytes.Buffer
|
||||||
|
|
||||||
|
// Detect postBody type and post.
|
||||||
|
if postBody != nil {
|
||||||
|
contentType := headerParams["Content-Type"]
|
||||||
|
if contentType == "" {
|
||||||
|
contentType = detectContentType(postBody)
|
||||||
|
headerParams["Content-Type"] = contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
body, err = setBody(postBody, contentType)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add form parameters and file if available.
|
||||||
|
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
|
||||||
|
if body != nil {
|
||||||
|
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
|
||||||
|
}
|
||||||
|
body = &bytes.Buffer{}
|
||||||
|
w := multipart.NewWriter(body)
|
||||||
|
|
||||||
|
for k, v := range formParams {
|
||||||
|
for _, iv := range v {
|
||||||
|
if strings.HasPrefix(k, "@") { // file
|
||||||
|
err = addFile(w, k[1:], iv)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
} else { // form value
|
||||||
|
w.WriteField(k, iv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(fileBytes) > 0 && fileName != "" {
|
||||||
|
w.Boundary()
|
||||||
|
//_, fileNm := filepath.Split(fileName)
|
||||||
|
part, err := w.CreateFormFile("file", filepath.Base(fileName))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
_, err = part.Write(fileBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// Set the Boundary in the Content-Type
|
||||||
|
headerParams["Content-Type"] = w.FormDataContentType()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set Content-Length
|
||||||
|
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||||
|
w.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
|
||||||
|
if body != nil {
|
||||||
|
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
|
||||||
|
}
|
||||||
|
body = &bytes.Buffer{}
|
||||||
|
body.WriteString(formParams.Encode())
|
||||||
|
// Set Content-Length
|
||||||
|
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup path and query parameters
|
||||||
|
url, err := url.Parse(path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adding Query Param
|
||||||
|
query := url.Query()
|
||||||
|
for k, v := range queryParams {
|
||||||
|
for _, iv := range v {
|
||||||
|
query.Add(k, iv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Encode the parameters.
|
||||||
|
url.RawQuery = query.Encode()
|
||||||
|
|
||||||
|
// Generate a new request
|
||||||
|
if body != nil {
|
||||||
|
localVarRequest, err = http.NewRequest(method, url.String(), body)
|
||||||
|
} else {
|
||||||
|
localVarRequest, err = http.NewRequest(method, url.String(), nil)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// add header parameters, if any
|
||||||
|
if len(headerParams) > 0 {
|
||||||
|
headers := http.Header{}
|
||||||
|
for h, v := range headerParams {
|
||||||
|
headers.Set(h, v)
|
||||||
|
}
|
||||||
|
localVarRequest.Header = headers
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override request host, if applicable
|
||||||
|
if c.cfg.Host != "" {
|
||||||
|
localVarRequest.Host = c.cfg.Host
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the user agent to the request.
|
||||||
|
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
|
||||||
|
|
||||||
|
if ctx != nil {
|
||||||
|
// add context to the request
|
||||||
|
localVarRequest = localVarRequest.WithContext(ctx)
|
||||||
|
|
||||||
|
// Walk through any authentication.
|
||||||
|
|
||||||
|
// OAuth2 authentication
|
||||||
|
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
|
||||||
|
// We were able to grab an oauth2 token from the context
|
||||||
|
var latestToken *oauth2.Token
|
||||||
|
if latestToken, err = tok.Token(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
latestToken.SetAuthHeader(localVarRequest)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Basic HTTP Authentication
|
||||||
|
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
|
||||||
|
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccessToken Authentication
|
||||||
|
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
|
||||||
|
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for header, value := range c.cfg.DefaultHeader {
|
||||||
|
localVarRequest.Header.Add(header, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarRequest, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
|
||||||
|
if strings.Contains(contentType, "application/xml") {
|
||||||
|
if err = xml.Unmarshal(b, v); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
} else if strings.Contains(contentType, "application/json") {
|
||||||
|
if err = json.Unmarshal(b, v); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return errors.New("undefined response type")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a file to the multipart request
|
||||||
|
func addFile(w *multipart.Writer, fieldName, path string) error {
|
||||||
|
file, err := os.Open(path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
|
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = io.Copy(part, file)
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent trying to import "fmt"
|
||||||
|
func reportError(format string, a ...interface{}) error {
|
||||||
|
return fmt.Errorf(format, a...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set request body from an interface{}
|
||||||
|
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
|
||||||
|
if bodyBuf == nil {
|
||||||
|
bodyBuf = &bytes.Buffer{}
|
||||||
|
}
|
||||||
|
|
||||||
|
if reader, ok := body.(io.Reader); ok {
|
||||||
|
_, err = bodyBuf.ReadFrom(reader)
|
||||||
|
} else if b, ok := body.([]byte); ok {
|
||||||
|
_, err = bodyBuf.Write(b)
|
||||||
|
} else if s, ok := body.(string); ok {
|
||||||
|
_, err = bodyBuf.WriteString(s)
|
||||||
|
} else if s, ok := body.(*string); ok {
|
||||||
|
_, err = bodyBuf.WriteString(*s)
|
||||||
|
} else if jsonCheck.MatchString(contentType) {
|
||||||
|
err = json.NewEncoder(bodyBuf).Encode(body)
|
||||||
|
} else if xmlCheck.MatchString(contentType) {
|
||||||
|
xml.NewEncoder(bodyBuf).Encode(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if bodyBuf.Len() == 0 {
|
||||||
|
err = fmt.Errorf("Invalid body type %s\n", contentType)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return bodyBuf, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// detectContentType method is used to figure out `Request.Body` content type for request header
|
||||||
|
func detectContentType(body interface{}) string {
|
||||||
|
contentType := "text/plain; charset=utf-8"
|
||||||
|
kind := reflect.TypeOf(body).Kind()
|
||||||
|
|
||||||
|
switch kind {
|
||||||
|
case reflect.Struct, reflect.Map, reflect.Ptr:
|
||||||
|
contentType = "application/json; charset=utf-8"
|
||||||
|
case reflect.String:
|
||||||
|
contentType = "text/plain; charset=utf-8"
|
||||||
|
default:
|
||||||
|
if b, ok := body.([]byte); ok {
|
||||||
|
contentType = http.DetectContentType(b)
|
||||||
|
} else if kind == reflect.Slice {
|
||||||
|
contentType = "application/json; charset=utf-8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
|
||||||
|
type cacheControl map[string]string
|
||||||
|
|
||||||
|
func parseCacheControl(headers http.Header) cacheControl {
|
||||||
|
cc := cacheControl{}
|
||||||
|
ccHeader := headers.Get("Cache-Control")
|
||||||
|
for _, part := range strings.Split(ccHeader, ",") {
|
||||||
|
part = strings.Trim(part, " ")
|
||||||
|
if part == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.ContainsRune(part, '=') {
|
||||||
|
keyval := strings.Split(part, "=")
|
||||||
|
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
|
||||||
|
} else {
|
||||||
|
cc[part] = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cc
|
||||||
|
}
|
||||||
|
|
||||||
|
// CacheExpires helper function to determine remaining time before repeating a request.
|
||||||
|
func CacheExpires(r *http.Response) time.Time {
|
||||||
|
// Figure out when the cache expires.
|
||||||
|
var expires time.Time
|
||||||
|
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
|
||||||
|
if err != nil {
|
||||||
|
return time.Now()
|
||||||
|
}
|
||||||
|
respCacheControl := parseCacheControl(r.Header)
|
||||||
|
|
||||||
|
if maxAge, ok := respCacheControl["max-age"]; ok {
|
||||||
|
lifetime, err := time.ParseDuration(maxAge + "s")
|
||||||
|
if err != nil {
|
||||||
|
expires = now
|
||||||
|
}
|
||||||
|
expires = now.Add(lifetime)
|
||||||
|
} else {
|
||||||
|
expiresHeader := r.Header.Get("Expires")
|
||||||
|
if expiresHeader != "" {
|
||||||
|
expires, err = time.Parse(time.RFC1123, expiresHeader)
|
||||||
|
if err != nil {
|
||||||
|
expires = now
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return expires
|
||||||
|
}
|
||||||
|
|
||||||
|
func strlen(s string) int {
|
||||||
|
return utf8.RuneCountInString(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GenericSwaggerError Provides access to the body, error and model on returned errors.
|
||||||
|
type GenericSwaggerError struct {
|
||||||
|
body []byte
|
||||||
|
error string
|
||||||
|
model interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error returns non-empty string if there was an error.
|
||||||
|
func (e GenericSwaggerError) Error() string {
|
||||||
|
return e.error
|
||||||
|
}
|
||||||
|
|
||||||
|
// Body returns the raw bytes of the response
|
||||||
|
func (e GenericSwaggerError) Body() []byte {
|
||||||
|
return e.body
|
||||||
|
}
|
||||||
|
|
||||||
|
// Model returns the unpacked model of the error
|
||||||
|
func (e GenericSwaggerError) Model() interface{} {
|
||||||
|
return e.model
|
||||||
|
}
|
73
api-client/oc-catalog/configuration.go
Normal file
73
api-client/oc-catalog/configuration.go
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// contextKeys are used to identify the type of value in the context.
|
||||||
|
// Since these are string, it is possible to get a short description of the
|
||||||
|
// context key for logging and debugging using key.String().
|
||||||
|
|
||||||
|
type contextKey string
|
||||||
|
|
||||||
|
func (c contextKey) String() string {
|
||||||
|
return "auth " + string(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
|
||||||
|
ContextOAuth2 = contextKey("token")
|
||||||
|
|
||||||
|
// ContextBasicAuth takes BasicAuth as authentication for the request.
|
||||||
|
ContextBasicAuth = contextKey("basic")
|
||||||
|
|
||||||
|
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
|
||||||
|
ContextAccessToken = contextKey("accesstoken")
|
||||||
|
|
||||||
|
// ContextAPIKey takes an APIKey as authentication for the request
|
||||||
|
ContextAPIKey = contextKey("apikey")
|
||||||
|
)
|
||||||
|
|
||||||
|
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
||||||
|
type BasicAuth struct {
|
||||||
|
UserName string `json:"userName,omitempty"`
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
|
||||||
|
type APIKey struct {
|
||||||
|
Key string
|
||||||
|
Prefix string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Configuration struct {
|
||||||
|
BasePath string `json:"basePath,omitempty"`
|
||||||
|
Host string `json:"host,omitempty"`
|
||||||
|
Scheme string `json:"scheme,omitempty"`
|
||||||
|
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||||
|
UserAgent string `json:"userAgent,omitempty"`
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewConfiguration() *Configuration {
|
||||||
|
cfg := &Configuration{
|
||||||
|
BasePath: "https://localhost/v1",
|
||||||
|
DefaultHeader: make(map[string]string),
|
||||||
|
UserAgent: "Swagger-Codegen/1.0.0/go",
|
||||||
|
}
|
||||||
|
return cfg
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||||
|
c.DefaultHeader[key] = value
|
||||||
|
}
|
95
api-client/oc-catalog/docs/ComputingApi.md
Normal file
95
api-client/oc-catalog/docs/ComputingApi.md
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# \ComputingApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**ComputingControllerAddComputing**](ComputingApi.md#ComputingControllerAddComputing) | **Post** /computing/ |
|
||||||
|
[**ComputingControllerGetComputingByID**](ComputingApi.md#ComputingControllerGetComputingByID) | **Get** /computing/{ID} |
|
||||||
|
[**ComputingControllerGetMultipleComputingByIDs**](ComputingApi.md#ComputingControllerGetMultipleComputingByIDs) | **Get** /computing/multi/{IDs} |
|
||||||
|
|
||||||
|
|
||||||
|
# **ComputingControllerAddComputing**
|
||||||
|
> ComputingControllerAddComputing(ctx, body)
|
||||||
|
|
||||||
|
|
||||||
|
Submit a computing object
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**body** | [**ModelsComputingNewModel**](ModelsComputingNewModel.md)| The object content |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **ComputingControllerGetComputingByID**
|
||||||
|
> ModelsComputingModel ComputingControllerGetComputingByID(ctx, iD)
|
||||||
|
|
||||||
|
|
||||||
|
Find a computing resource based on ID
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iD** | **string**| The ID of the resource |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsComputingModel**](models.ComputingModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **ComputingControllerGetMultipleComputingByIDs**
|
||||||
|
> []ModelsComputingModel ComputingControllerGetMultipleComputingByIDs(ctx, iDs)
|
||||||
|
|
||||||
|
|
||||||
|
Return Computing objects if found in the DB. Not found IDs will be ignored
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iDs** | [**[]string**](string.md)| List of computing IDs |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsComputingModel**](models.ComputingModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
95
api-client/oc-catalog/docs/DataApi.md
Normal file
95
api-client/oc-catalog/docs/DataApi.md
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# \DataApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**DataControllerCreateData**](DataApi.md#DataControllerCreateData) | **Post** /data/ |
|
||||||
|
[**DataControllerGetDataByID**](DataApi.md#DataControllerGetDataByID) | **Get** /data/{ID} |
|
||||||
|
[**DataControllerGetMultipleDataByIDs**](DataApi.md#DataControllerGetMultipleDataByIDs) | **Get** /data/multi/{IDs} |
|
||||||
|
|
||||||
|
|
||||||
|
# **DataControllerCreateData**
|
||||||
|
> DataControllerCreateData(ctx, body)
|
||||||
|
|
||||||
|
|
||||||
|
Submit data object
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**body** | [**ModelsDataNewModel**](ModelsDataNewModel.md)| The object content |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **DataControllerGetDataByID**
|
||||||
|
> ModelsDataModel DataControllerGetDataByID(ctx, iD)
|
||||||
|
|
||||||
|
|
||||||
|
Find rType data based on ID
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iD** | **string**| The ID of the data resource |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsDataModel**](models.DataModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **DataControllerGetMultipleDataByIDs**
|
||||||
|
> []ModelsDataModel DataControllerGetMultipleDataByIDs(ctx, iDs)
|
||||||
|
|
||||||
|
|
||||||
|
Return Data object if found in the DB. Not found IDs will be ignored
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iDs** | [**[]string**](string.md)| List of data IDs |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsDataModel**](models.DataModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
95
api-client/oc-catalog/docs/DatacenterApi.md
Normal file
95
api-client/oc-catalog/docs/DatacenterApi.md
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# \DatacenterApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**DatacenterControllerCreateDatacenter**](DatacenterApi.md#DatacenterControllerCreateDatacenter) | **Post** /datacenter/ |
|
||||||
|
[**DatacenterControllerGetMultipleDatacentersByIDs**](DatacenterApi.md#DatacenterControllerGetMultipleDatacentersByIDs) | **Get** /datacenter/multi/{IDs} |
|
||||||
|
[**DatacenterControllerGetOneDatacenter**](DatacenterApi.md#DatacenterControllerGetOneDatacenter) | **Get** /datacenter/{ID} |
|
||||||
|
|
||||||
|
|
||||||
|
# **DatacenterControllerCreateDatacenter**
|
||||||
|
> DatacenterControllerCreateDatacenter(ctx, body)
|
||||||
|
|
||||||
|
|
||||||
|
submit Datacenter object
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**body** | [**ModelsDatacenterNewModel**](ModelsDatacenterNewModel.md)| The object content |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **DatacenterControllerGetMultipleDatacentersByIDs**
|
||||||
|
> []ModelsComputingModel DatacenterControllerGetMultipleDatacentersByIDs(ctx, iDs)
|
||||||
|
|
||||||
|
|
||||||
|
Return Datacenter objects if found in the DB. Not found IDs will be ignored
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iDs** | [**[]string**](string.md)| List of datacenter IDs |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsComputingModel**](models.ComputingModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **DatacenterControllerGetOneDatacenter**
|
||||||
|
> ModelsDatacenterModel DatacenterControllerGetOneDatacenter(ctx, iD)
|
||||||
|
|
||||||
|
|
||||||
|
find datacenter by ID
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iD** | **string**| the ID you want to get |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsDatacenterModel**](models.DatacenterModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
22
api-client/oc-catalog/docs/ModelsComputingModel.md
Normal file
22
api-client/oc-catalog/docs/ModelsComputingModel.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# ModelsComputingModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Dinputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**Doutputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**ID** | **string** | | [default to null]
|
||||||
|
**Description** | **string** | | [optional] [default to null]
|
||||||
|
**ExecutionRequirements** | [***ModelsExecutionRequirementsModel**](models.ExecutionRequirementsModel.md) | | [optional] [default to null]
|
||||||
|
**License** | **string** | | [optional] [default to null]
|
||||||
|
**Logo** | **string** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | Name of the computing | [optional] [default to null]
|
||||||
|
**Owner** | **string** | | [optional] [default to null]
|
||||||
|
**Price** | **int32** | | [optional] [default to null]
|
||||||
|
**Repository** | [***ModelsRepositoryModel**](models.RepositoryModel.md) | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [optional] [default to null]
|
||||||
|
**Type_** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
21
api-client/oc-catalog/docs/ModelsComputingNewModel.md
Normal file
21
api-client/oc-catalog/docs/ModelsComputingNewModel.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# ModelsComputingNewModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Dinputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**Doutputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**Description** | **string** | | [default to null]
|
||||||
|
**ExecutionRequirements** | [***ModelsExecutionRequirementsModel**](models.ExecutionRequirementsModel.md) | | [optional] [default to null]
|
||||||
|
**License** | **string** | | [optional] [default to null]
|
||||||
|
**Logo** | **string** | | [default to null]
|
||||||
|
**Name** | **string** | Name of the computing | [default to null]
|
||||||
|
**Owner** | **string** | | [optional] [default to null]
|
||||||
|
**Price** | **int32** | | [optional] [default to null]
|
||||||
|
**Repository** | [***ModelsRepositoryModel**](models.RepositoryModel.md) | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [default to null]
|
||||||
|
**Type_** | **string** | | [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
13
api-client/oc-catalog/docs/ModelsComputingObject.md
Normal file
13
api-client/oc-catalog/docs/ModelsComputingObject.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# ModelsComputingObject
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**DatacenterID** | **string** | Datacenter where the computing will be executed | [optional] [default to null]
|
||||||
|
**Inputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**Outputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**ReferenceID** | [***PrimitiveObjectId**](primitive.ObjectID.md) | Computing model ID | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
api-client/oc-catalog/docs/ModelsDCstatus.md
Normal file
15
api-client/oc-catalog/docs/ModelsDCstatus.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# ModelsDCstatus
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Booked** | [***ModelsScheduleInfo**](models.ScheduleInfo.md) | | [optional] [default to null]
|
||||||
|
**DCname** | **string** | | [optional] [default to null]
|
||||||
|
**DCobjID** | **string** | | [optional] [default to null]
|
||||||
|
**ErrorMessage** | **string** | | [optional] [default to null]
|
||||||
|
**IsAvailable** | **bool** | | [optional] [default to null]
|
||||||
|
**IsReachable** | **bool** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
19
api-client/oc-catalog/docs/ModelsDataModel.md
Normal file
19
api-client/oc-catalog/docs/ModelsDataModel.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# ModelsDataModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ID** | **string** | | [default to null]
|
||||||
|
**Description** | **string** | | [optional] [default to null]
|
||||||
|
**Dtype** | **string** | | [optional] [default to null]
|
||||||
|
**Example** | **string** | base64 encoded data | [optional] [default to null]
|
||||||
|
**Location** | **string** | | [optional] [default to null]
|
||||||
|
**Logo** | **string** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | Name of the data | [optional] [default to null]
|
||||||
|
**Protocol** | **[]string** | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [optional] [default to null]
|
||||||
|
**Type_** | **string** | Define type of data | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
18
api-client/oc-catalog/docs/ModelsDataNewModel.md
Normal file
18
api-client/oc-catalog/docs/ModelsDataNewModel.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# ModelsDataNewModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Description** | **string** | | [default to null]
|
||||||
|
**Dtype** | **string** | | [optional] [default to null]
|
||||||
|
**Example** | **string** | base64 encoded data | [default to null]
|
||||||
|
**Location** | **string** | | [default to null]
|
||||||
|
**Logo** | **string** | | [default to null]
|
||||||
|
**Name** | **string** | Name of the data | [default to null]
|
||||||
|
**Protocol** | **[]string** | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [default to null]
|
||||||
|
**Type_** | **string** | Define type of data | [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
10
api-client/oc-catalog/docs/ModelsDataObject.md
Normal file
10
api-client/oc-catalog/docs/ModelsDataObject.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# ModelsDataObject
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ReferenceID** | [***PrimitiveObjectId**](primitive.ObjectID.md) | Data model ID | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
14
api-client/oc-catalog/docs/ModelsDatacenterCpuModel.md
Normal file
14
api-client/oc-catalog/docs/ModelsDatacenterCpuModel.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# ModelsDatacenterCpuModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Architecture** | **string** | | [optional] [default to null]
|
||||||
|
**Cores** | **int32** | | [default to null]
|
||||||
|
**MinimumMemory** | **int32** | | [optional] [default to null]
|
||||||
|
**Platform** | **string** | | [optional] [default to null]
|
||||||
|
**Shared** | **bool** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
13
api-client/oc-catalog/docs/ModelsDatacenterGpuModel.md
Normal file
13
api-client/oc-catalog/docs/ModelsDatacenterGpuModel.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# ModelsDatacenterGpuModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**CudaCores** | **int32** | | [optional] [default to null]
|
||||||
|
**Memory** | **int32** | Units in MB | [optional] [default to null]
|
||||||
|
**Model** | **string** | | [optional] [default to null]
|
||||||
|
**TensorCores** | **int32** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
api-client/oc-catalog/docs/ModelsDatacenterMemoryModel.md
Normal file
11
api-client/oc-catalog/docs/ModelsDatacenterMemoryModel.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# ModelsDatacenterMemoryModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Ecc** | **bool** | | [optional] [default to null]
|
||||||
|
**Size** | **int32** | Units in MB | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
22
api-client/oc-catalog/docs/ModelsDatacenterModel.md
Normal file
22
api-client/oc-catalog/docs/ModelsDatacenterModel.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# ModelsDatacenterModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ID** | **string** | | [default to null]
|
||||||
|
**Acronym** | **string** | id of the DC | [optional] [default to null]
|
||||||
|
**BookingPrice** | **int64** | | [optional] [default to null]
|
||||||
|
**Cpu** | [***ModelsDatacenterCpuModel**](models.DatacenterCpuModel.md) | | [optional] [default to null]
|
||||||
|
**Description** | **string** | | [optional] [default to null]
|
||||||
|
**Gpu** | [**[]ModelsDatacenterGpuModel**](models.DatacenterGpuModel.md) | | [optional] [default to null]
|
||||||
|
**Hosts** | **[]string** | list of host:port | [optional] [default to null]
|
||||||
|
**Logo** | **string** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [optional] [default to null]
|
||||||
|
**Owner** | **string** | | [optional] [default to null]
|
||||||
|
**Ram** | [***ModelsDatacenterMemoryModel**](models.DatacenterMemoryModel.md) | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [optional] [default to null]
|
||||||
|
**Type_** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
21
api-client/oc-catalog/docs/ModelsDatacenterNewModel.md
Normal file
21
api-client/oc-catalog/docs/ModelsDatacenterNewModel.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# ModelsDatacenterNewModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Acronym** | **string** | id of the DC | [default to null]
|
||||||
|
**BookingPrice** | **int64** | | [optional] [default to null]
|
||||||
|
**Cpu** | [***ModelsDatacenterCpuModel**](models.DatacenterCpuModel.md) | | [default to null]
|
||||||
|
**Description** | **string** | | [default to null]
|
||||||
|
**Gpu** | [**[]ModelsDatacenterGpuModel**](models.DatacenterGpuModel.md) | | [default to null]
|
||||||
|
**Hosts** | **[]string** | list of host:port | [default to null]
|
||||||
|
**Logo** | **string** | | [default to null]
|
||||||
|
**Name** | **string** | | [default to null]
|
||||||
|
**Owner** | **string** | | [optional] [default to null]
|
||||||
|
**Ram** | [***ModelsDatacenterMemoryModel**](models.DatacenterMemoryModel.md) | | [default to null]
|
||||||
|
**ShortDescription** | **string** | | [default to null]
|
||||||
|
**Type_** | **string** | | [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
10
api-client/oc-catalog/docs/ModelsDatacenterObject.md
Normal file
10
api-client/oc-catalog/docs/ModelsDatacenterObject.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# ModelsDatacenterObject
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ReferenceID** | [***PrimitiveObjectId**](primitive.ObjectID.md) | Data model ID | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
# ModelsExecutionRequirementsModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Cpus** | **int32** | | [default to null]
|
||||||
|
**DiskIo** | **string** | | [optional] [default to null]
|
||||||
|
**Gpus** | **int32** | Amount of GPUs needed | [optional] [default to null]
|
||||||
|
**Parallel** | **bool** | | [optional] [default to null]
|
||||||
|
**Ram** | **int32** | Units in MB | [default to null]
|
||||||
|
**ScalingModel** | **int32** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
api-client/oc-catalog/docs/ModelsRepositoryModel.md
Normal file
11
api-client/oc-catalog/docs/ModelsRepositoryModel.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# ModelsRepositoryModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Credentials** | **string** | | [optional] [default to null]
|
||||||
|
**Url** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
13
api-client/oc-catalog/docs/ModelsScheduleDb.md
Normal file
13
api-client/oc-catalog/docs/ModelsScheduleDb.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# ModelsScheduleDb
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ResourceQty** | [***ModelsExecutionRequirementsModel**](models.ExecutionRequirementsModel.md) | | [optional] [default to null]
|
||||||
|
**StartDate** | **string** | | [optional] [default to null]
|
||||||
|
**StopDate** | **string** | | [optional] [default to null]
|
||||||
|
**Workflow** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
api-client/oc-catalog/docs/ModelsScheduleInfo.md
Normal file
11
api-client/oc-catalog/docs/ModelsScheduleInfo.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# ModelsScheduleInfo
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**NextExecutions** | **[]string** | | [optional] [default to null]
|
||||||
|
**Total** | **int64** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
9
api-client/oc-catalog/docs/ModelsScheduleTime.md
Normal file
9
api-client/oc-catalog/docs/ModelsScheduleTime.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# ModelsScheduleTime
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
13
api-client/oc-catalog/docs/ModelsSearchResult.md
Normal file
13
api-client/oc-catalog/docs/ModelsSearchResult.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# ModelsSearchResult
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Computing** | [**[]ModelsComputingModel**](models.ComputingModel.md) | | [default to null]
|
||||||
|
**Data** | [**[]ModelsDataModel**](models.DataModel.md) | | [optional] [default to null]
|
||||||
|
**Datacenter** | [**[]ModelsDatacenterModel**](models.DatacenterModel.md) | | [optional] [default to null]
|
||||||
|
**Storage** | [**[]ModelsStorageModel**](models.StorageModel.md) | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
21
api-client/oc-catalog/docs/ModelsStorageModel.md
Normal file
21
api-client/oc-catalog/docs/ModelsStorageModel.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# ModelsStorageModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**DCacronym** | **string** | Unique ID of the DC where it is the storage | [optional] [default to null]
|
||||||
|
**ID** | **string** | | [default to null]
|
||||||
|
**BookingPrice** | **int32** | | [optional] [default to null]
|
||||||
|
**Description** | **string** | | [optional] [default to null]
|
||||||
|
**Encryption** | **bool** | | [optional] [default to null]
|
||||||
|
**Logo** | **string** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [optional] [default to null]
|
||||||
|
**Redundancy** | **string** | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [optional] [default to null]
|
||||||
|
**Size** | **int32** | | [optional] [default to null]
|
||||||
|
**Throughput** | **string** | | [optional] [default to null]
|
||||||
|
**Type_** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
20
api-client/oc-catalog/docs/ModelsStorageNewModel.md
Normal file
20
api-client/oc-catalog/docs/ModelsStorageNewModel.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# ModelsStorageNewModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**DCacronym** | **string** | Unique ID of the DC where it is the storage | [default to null]
|
||||||
|
**BookingPrice** | **int32** | | [optional] [default to null]
|
||||||
|
**Description** | **string** | | [default to null]
|
||||||
|
**Encryption** | **bool** | | [optional] [default to null]
|
||||||
|
**Logo** | **string** | | [default to null]
|
||||||
|
**Name** | **string** | | [default to null]
|
||||||
|
**Redundancy** | **string** | | [optional] [default to null]
|
||||||
|
**ShortDescription** | **string** | | [default to null]
|
||||||
|
**Size** | **int32** | | [default to null]
|
||||||
|
**Throughput** | **string** | | [optional] [default to null]
|
||||||
|
**Type_** | **string** | | [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
12
api-client/oc-catalog/docs/ModelsStorageObject.md
Normal file
12
api-client/oc-catalog/docs/ModelsStorageObject.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# ModelsStorageObject
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Inputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**Outputs** | **[]string** | | [optional] [default to null]
|
||||||
|
**ReferenceID** | [***PrimitiveObjectId**](primitive.ObjectID.md) | Storage model ID | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
api-client/oc-catalog/docs/ModelsWorkflow.md
Normal file
15
api-client/oc-catalog/docs/ModelsWorkflow.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# ModelsWorkflow
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**MxgraphXML** | **string** | State of the mxgraph | [optional] [default to null]
|
||||||
|
**Computing** | [***ModelsComputingObject**](models.ComputingObject.md) | | [optional] [default to null]
|
||||||
|
**Data** | [***ModelsDataObject**](models.DataObject.md) | | [optional] [default to null]
|
||||||
|
**Datacenter** | [***ModelsDatacenterObject**](models.DatacenterObject.md) | | [optional] [default to null]
|
||||||
|
**Schedules** | [***ModelsWorkflowSchedule**](models.WorkflowSchedule.md) | | [optional] [default to null]
|
||||||
|
**Storage** | [***ModelsStorageObject**](models.StorageObject.md) | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
16
api-client/oc-catalog/docs/ModelsWorkflowSchedule.md
Normal file
16
api-client/oc-catalog/docs/ModelsWorkflowSchedule.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# ModelsWorkflowSchedule
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**IsService** | **bool** | Service: true, Task: false | [optional] [default to null]
|
||||||
|
**StartDate** | **string** | | [optional] [default to null]
|
||||||
|
**StopDate** | **string** | | [optional] [default to null]
|
||||||
|
**Cron** | **string** | | [optional] [default to null]
|
||||||
|
**Duration** | **int32** | Durantion in seconds | [optional] [default to null]
|
||||||
|
**Events** | **string** | | [optional] [default to null]
|
||||||
|
**IsBooked** | **bool** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
api-client/oc-catalog/docs/ModelsWorkspace.md
Normal file
15
api-client/oc-catalog/docs/ModelsWorkspace.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# ModelsWorkspace
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Workflows** | [***ModelsWorkflow**](models.Workflow.md) | | [optional] [default to null]
|
||||||
|
**Computing** | **[]string** | | [optional] [default to null]
|
||||||
|
**Data** | **[]string** | | [optional] [default to null]
|
||||||
|
**Datacenter** | **[]string** | | [optional] [default to null]
|
||||||
|
**Storage** | **[]string** | | [optional] [default to null]
|
||||||
|
**UserId** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
14
api-client/oc-catalog/docs/ModelsWorkspaceModel.md
Normal file
14
api-client/oc-catalog/docs/ModelsWorkspaceModel.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# ModelsWorkspaceModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Computing** | [**[]ModelsComputingModel**](models.ComputingModel.md) | | [optional] [default to null]
|
||||||
|
**Data** | [**[]ModelsDataModel**](models.DataModel.md) | | [optional] [default to null]
|
||||||
|
**Datacenter** | [**[]ModelsDatacenterModel**](models.DatacenterModel.md) | | [optional] [default to null]
|
||||||
|
**Storage** | [**[]ModelsStorageModel**](models.StorageModel.md) | | [optional] [default to null]
|
||||||
|
**UserId** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
9
api-client/oc-catalog/docs/PrimitiveObjectId.md
Normal file
9
api-client/oc-catalog/docs/PrimitiveObjectId.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# PrimitiveObjectId
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
164
api-client/oc-catalog/docs/ScheduleApi.md
Normal file
164
api-client/oc-catalog/docs/ScheduleApi.md
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
# \ScheduleApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**ScheduleControllerCheckIfScheduleCanBeCreatedInThisDC**](ScheduleApi.md#ScheduleControllerCheckIfScheduleCanBeCreatedInThisDC) | **Post** /schedule/check |
|
||||||
|
[**ScheduleControllerCreateSchedule**](ScheduleApi.md#ScheduleControllerCreateSchedule) | **Post** /schedule/book |
|
||||||
|
[**ScheduleControllerGetNextSchedule**](ScheduleApi.md#ScheduleControllerGetNextSchedule) | **Get** /schedule/next |
|
||||||
|
[**ScheduleControllerGetPreviousSchedule**](ScheduleApi.md#ScheduleControllerGetPreviousSchedule) | **Get** /schedule/previous |
|
||||||
|
[**ScheduleControllerGetSchedules**](ScheduleApi.md#ScheduleControllerGetSchedules) | **Get** /schedule/ |
|
||||||
|
|
||||||
|
|
||||||
|
# **ScheduleControllerCheckIfScheduleCanBeCreatedInThisDC**
|
||||||
|
> ScheduleControllerCheckIfScheduleCanBeCreatedInThisDC(ctx, cron, duration, startDate, stopDate, requirements)
|
||||||
|
|
||||||
|
|
||||||
|
Check for availability of this DC
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**cron** | **string**| Cron syntax |
|
||||||
|
**duration** | **int32**| Duration in seconds |
|
||||||
|
**startDate** | [**interface{}**](.md)| RFC3339 time for startDate |
|
||||||
|
**stopDate** | [**interface{}**](.md)| RFC3339 time for stopDate |
|
||||||
|
**requirements** | [**ModelsExecutionRequirementsModel**](ModelsExecutionRequirementsModel.md)| The object content |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **ScheduleControllerCreateSchedule**
|
||||||
|
> ModelsScheduleInfo ScheduleControllerCreateSchedule(ctx, dcName, workflowName, cron, duration, startDate, stopDate, requirements)
|
||||||
|
|
||||||
|
|
||||||
|
Create schedule for a workflow. It will return some future executions just as information
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**dcName** | **string**| Name of the node (oc-catalog) from where the workflow comes. |
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
**cron** | **string**| Cron syntax with year. If no year is specified, will use the current |
|
||||||
|
**duration** | **int32**| Duration in seconds |
|
||||||
|
**startDate** | [**interface{}**](.md)| RFC3339 time for startDate |
|
||||||
|
**stopDate** | [**interface{}**](.md)| RFC3339 time for stopDate |
|
||||||
|
**requirements** | [**ModelsExecutionRequirementsModel**](ModelsExecutionRequirementsModel.md)| The object content |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsScheduleInfo**](models.ScheduleInfo.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **ScheduleControllerGetNextSchedule**
|
||||||
|
> TimeTime ScheduleControllerGetNextSchedule(ctx, baseDate)
|
||||||
|
|
||||||
|
|
||||||
|
Give a date, get the next date where there are at least on schedule. If no hours specified, will assume 00:00
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**baseDate** | [**interface{}**](.md)| Base date |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**TimeTime**](*time.Time.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **ScheduleControllerGetPreviousSchedule**
|
||||||
|
> TimeTime ScheduleControllerGetPreviousSchedule(ctx, baseDate)
|
||||||
|
|
||||||
|
|
||||||
|
Give a date, get the previous date where there are at least on schedule. If no hours specified, will assume 00:00
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**baseDate** | [**interface{}**](.md)| Base date |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**TimeTime**](*time.Time.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **ScheduleControllerGetSchedules**
|
||||||
|
> []ModelsScheduleDb ScheduleControllerGetSchedules(ctx, startDate, stopDate)
|
||||||
|
|
||||||
|
|
||||||
|
Get a list of next startDates schedules (inclusive). If timezone is not specified, will assume UTC
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**startDate** | [**interface{}**](.md)| Start date |
|
||||||
|
**stopDate** | [**interface{}**](.md)| End date |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsScheduleDb**](models.ScheduleDB.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
37
api-client/oc-catalog/docs/SearchApi.md
Normal file
37
api-client/oc-catalog/docs/SearchApi.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# \SearchApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**SearchControllerSearchByWord**](SearchApi.md#SearchControllerSearchByWord) | **Get** /search/byWord |
|
||||||
|
|
||||||
|
|
||||||
|
# **SearchControllerSearchByWord**
|
||||||
|
> ModelsSearchResult SearchControllerSearchByWord(ctx, word)
|
||||||
|
|
||||||
|
|
||||||
|
find resources by word
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**word** | **string**| Word to search across all resources |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsSearchResult**](models.SearchResult.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
95
api-client/oc-catalog/docs/StorageApi.md
Normal file
95
api-client/oc-catalog/docs/StorageApi.md
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# \StorageApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**StorageControllerCreateStorage**](StorageApi.md#StorageControllerCreateStorage) | **Post** /storage/ |
|
||||||
|
[**StorageControllerGet**](StorageApi.md#StorageControllerGet) | **Get** /storage/{ID} |
|
||||||
|
[**StorageControllerGetMultipleStoragesByIDs**](StorageApi.md#StorageControllerGetMultipleStoragesByIDs) | **Get** /storage/multi/{IDs} |
|
||||||
|
|
||||||
|
|
||||||
|
# **StorageControllerCreateStorage**
|
||||||
|
> StorageControllerCreateStorage(ctx, body)
|
||||||
|
|
||||||
|
|
||||||
|
submit storage object
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**body** | [**ModelsStorageNewModel**](ModelsStorageNewModel.md)| The object content |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **StorageControllerGet**
|
||||||
|
> ModelsStorageModel StorageControllerGet(ctx, iD)
|
||||||
|
|
||||||
|
|
||||||
|
find storage by ID
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iD** | **string**| the ID you want to get |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsStorageModel**](models.StorageModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **StorageControllerGetMultipleStoragesByIDs**
|
||||||
|
> []ModelsComputingModel StorageControllerGetMultipleStoragesByIDs(ctx, iDs)
|
||||||
|
|
||||||
|
|
||||||
|
Return Storage objects if found in the DB. Not found IDs will be ignored
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**iDs** | [**[]string**](string.md)| List of storage IDs |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsComputingModel**](models.ComputingModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
9
api-client/oc-catalog/docs/TimeTime.md
Normal file
9
api-client/oc-catalog/docs/TimeTime.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# TimeTime
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
63
api-client/oc-catalog/docs/UserApi.md
Normal file
63
api-client/oc-catalog/docs/UserApi.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# \UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**UserControllerLogin**](UserApi.md#UserControllerLogin) | **Get** /user/login |
|
||||||
|
[**UserControllerLogout**](UserApi.md#UserControllerLogout) | **Get** /user/logout |
|
||||||
|
|
||||||
|
|
||||||
|
# **UserControllerLogin**
|
||||||
|
> UserControllerLogin(ctx, username, password)
|
||||||
|
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**username** | **string**| The username for login |
|
||||||
|
**password** | **string**| The password for login |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **UserControllerLogout**
|
||||||
|
> UserControllerLogout(ctx, )
|
||||||
|
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
345
api-client/oc-catalog/docs/WorkflowApi.md
Normal file
345
api-client/oc-catalog/docs/WorkflowApi.md
Normal file
@ -0,0 +1,345 @@
|
|||||||
|
# \WorkflowApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**WorkflowControllerAddNewObjectToAWorkflow**](WorkflowApi.md#WorkflowControllerAddNewObjectToAWorkflow) | **Post** /workflow/{workflowName}/add |
|
||||||
|
[**WorkflowControllerBookSchedule**](WorkflowApi.md#WorkflowControllerBookSchedule) | **Post** /workflow/{workflowName}/schedule/book |
|
||||||
|
[**WorkflowControllerCheckSchedule**](WorkflowApi.md#WorkflowControllerCheckSchedule) | **Get** /workflow/{workflowName}/schedule/check |
|
||||||
|
[**WorkflowControllerCreateANewWorkflow**](WorkflowApi.md#WorkflowControllerCreateANewWorkflow) | **Post** /workflow/ |
|
||||||
|
[**WorkflowControllerCreateARealtionshipBetweenTwoRobjects**](WorkflowApi.md#WorkflowControllerCreateARealtionshipBetweenTwoRobjects) | **Post** /workflow/{workflowName}/link |
|
||||||
|
[**WorkflowControllerGetMxGraphLastStatus**](WorkflowApi.md#WorkflowControllerGetMxGraphLastStatus) | **Get** /workflow/{workflowName}/mxGraphParser |
|
||||||
|
[**WorkflowControllerGetSchedule**](WorkflowApi.md#WorkflowControllerGetSchedule) | **Get** /workflow/{workflowName}/schedule |
|
||||||
|
[**WorkflowControllerGetWorkflow**](WorkflowApi.md#WorkflowControllerGetWorkflow) | **Get** /workflow/{workflowName} |
|
||||||
|
[**WorkflowControllerListWorkflows**](WorkflowApi.md#WorkflowControllerListWorkflows) | **Get** /workflow/ |
|
||||||
|
[**WorkflowControllerParseMxGraph**](WorkflowApi.md#WorkflowControllerParseMxGraph) | **Post** /workflow/{workflowName}/mxGraphParser |
|
||||||
|
[**WorkflowControllerSetSchedule**](WorkflowApi.md#WorkflowControllerSetSchedule) | **Put** /workflow/{workflowName}/schedule |
|
||||||
|
|
||||||
|
|
||||||
|
# **WorkflowControllerAddNewObjectToAWorkflow**
|
||||||
|
> WorkflowControllerAddNewObjectToAWorkflow(ctx, workflowName, rID)
|
||||||
|
|
||||||
|
|
||||||
|
Create a Rtype object from already added resources to the workspace
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| workflow Name |
|
||||||
|
**rID** | **string**| rID of already existing item in Workspace |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerBookSchedule**
|
||||||
|
> []ModelsDCstatus WorkflowControllerBookSchedule(ctx, workflowName)
|
||||||
|
|
||||||
|
|
||||||
|
Book a schedule in all DCs of the workflow. Must set a desired schedule first!
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsDCstatus**](models.DCstatus.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerCheckSchedule**
|
||||||
|
> []ModelsDCstatus WorkflowControllerCheckSchedule(ctx, workflowName)
|
||||||
|
|
||||||
|
|
||||||
|
Check if we can schedule the project in other DCs. Must set a desired schedule first!
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]ModelsDCstatus**](models.DCstatus.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerCreateANewWorkflow**
|
||||||
|
> WorkflowControllerCreateANewWorkflow(ctx, workflowName)
|
||||||
|
|
||||||
|
|
||||||
|
Create a name for the new workflow
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Name of the workflow |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerCreateARealtionshipBetweenTwoRobjects**
|
||||||
|
> WorkflowControllerCreateARealtionshipBetweenTwoRobjects(ctx, workflowName, rObjIDsource, isInput, rObjIDtarger)
|
||||||
|
|
||||||
|
|
||||||
|
Create a Rtype object from already added resources to the workspace
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
**rObjIDsource** | **string**| Robject source. Usually Data |
|
||||||
|
**isInput** | **bool**| If the operation is for input (true) linkage or output (false) |
|
||||||
|
**rObjIDtarger** | **string**| Robject where will be written the association |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerGetMxGraphLastStatus**
|
||||||
|
> WorkflowControllerGetMxGraphLastStatus(ctx, workflowName)
|
||||||
|
|
||||||
|
|
||||||
|
Obtain the last mxgraph XML status from the workflow
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerGetSchedule**
|
||||||
|
> ModelsScheduleTime WorkflowControllerGetSchedule(ctx, workflowName)
|
||||||
|
|
||||||
|
|
||||||
|
Obtain the desired schedule of this workflow
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsScheduleTime**](models.ScheduleTime.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerGetWorkflow**
|
||||||
|
> ModelsWorkflow WorkflowControllerGetWorkflow(ctx, workflowName)
|
||||||
|
|
||||||
|
|
||||||
|
Get a workflow by name
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsWorkflow**](models.Workflow.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerListWorkflows**
|
||||||
|
> WorkflowControllerListWorkflows(ctx, )
|
||||||
|
|
||||||
|
|
||||||
|
List available workflows
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerParseMxGraph**
|
||||||
|
> WorkflowControllerParseMxGraph(ctx, workflowName, xmlData)
|
||||||
|
|
||||||
|
|
||||||
|
If we use this aproach to transofrm mxgraph representation in our representation, we should not use other API calls for modify the project structure or we'll have inconsistencies.
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
**xmlData** | **string**| Xml representation of the workflow |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkflowControllerSetSchedule**
|
||||||
|
> ModelsScheduleInfo WorkflowControllerSetSchedule(ctx, workflowName, isService, startDate, stopDate, optional)
|
||||||
|
|
||||||
|
|
||||||
|
Set desired schedule by the user. No other effects a part of saving the user input
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**workflowName** | **string**| Workflow Name |
|
||||||
|
**isService** | **bool**| True: Service, False: Task |
|
||||||
|
**startDate** | [**interface{}**](.md)| RFC3339 time for startDate |
|
||||||
|
**stopDate** | [**interface{}**](.md)| RFC3339 time for stopDate |
|
||||||
|
**optional** | ***WorkflowApiWorkflowControllerSetScheduleOpts** | optional parameters | nil if no parameters
|
||||||
|
|
||||||
|
### Optional Parameters
|
||||||
|
Optional parameters are passed through a pointer to a WorkflowApiWorkflowControllerSetScheduleOpts struct
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**events** | **optional.String**| List of events separated by comma |
|
||||||
|
**cronString** | **optional.String**| Cron string |
|
||||||
|
**duration** | **optional.Int32**| Duration in seconds |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsScheduleInfo**](models.ScheduleInfo.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
118
api-client/oc-catalog/docs/WorkspaceApi.md
Normal file
118
api-client/oc-catalog/docs/WorkspaceApi.md
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
# \WorkspaceApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://localhost/v1*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**WorkspaceControllerAddModelToWorkspace**](WorkspaceApi.md#WorkspaceControllerAddModelToWorkspace) | **Post** /workspace/ |
|
||||||
|
[**WorkspaceControllerDeleteElementFromUserWorkspace**](WorkspaceApi.md#WorkspaceControllerDeleteElementFromUserWorkspace) | **Delete** /workspace/ |
|
||||||
|
[**WorkspaceControllerGetFullWorkspace**](WorkspaceApi.md#WorkspaceControllerGetFullWorkspace) | **Get** /workspace/list_model |
|
||||||
|
[**WorkspaceControllerGetWorkspace**](WorkspaceApi.md#WorkspaceControllerGetWorkspace) | **Get** /workspace/list |
|
||||||
|
|
||||||
|
|
||||||
|
# **WorkspaceControllerAddModelToWorkspace**
|
||||||
|
> WorkspaceControllerAddModelToWorkspace(ctx, id, rtype)
|
||||||
|
|
||||||
|
|
||||||
|
Insert a resource in the workspace
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**id** | **string**| ID of a resource |
|
||||||
|
**rtype** | **string**| Type of resource |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkspaceControllerDeleteElementFromUserWorkspace**
|
||||||
|
> WorkspaceControllerDeleteElementFromUserWorkspace(ctx, id, rtype)
|
||||||
|
|
||||||
|
|
||||||
|
Remove a resource from the workspace
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||||
|
**id** | **string**| ID of a resource |
|
||||||
|
**rtype** | **string**| Type of resource |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkspaceControllerGetFullWorkspace**
|
||||||
|
> ModelsWorkspaceModel WorkspaceControllerGetFullWorkspace(ctx, )
|
||||||
|
|
||||||
|
|
||||||
|
Get full workspace elements based on user_id token
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsWorkspaceModel**](models.WorkspaceModel.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **WorkspaceControllerGetWorkspace**
|
||||||
|
> ModelsWorkspace WorkspaceControllerGetWorkspace(ctx, )
|
||||||
|
|
||||||
|
|
||||||
|
Get workspace elements based on user_id token
|
||||||
|
|
||||||
|
### Required Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelsWorkspace**](models.Workspace.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
52
api-client/oc-catalog/git_push.sh
Normal file
52
api-client/oc-catalog/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id="GIT_USER_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="GIT_REPO_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="Minor update"
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=`git remote`
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
|
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
28
api-client/oc-catalog/model_models_computing_model.go
Normal file
28
api-client/oc-catalog/model_models_computing_model.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsComputingModel struct {
|
||||||
|
Dinputs []string `json:"Dinputs,omitempty"`
|
||||||
|
Doutputs []string `json:"Doutputs,omitempty"`
|
||||||
|
ID string `json:"ID"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
ExecutionRequirements *ModelsExecutionRequirementsModel `json:"execution_requirements,omitempty"`
|
||||||
|
License string `json:"license,omitempty"`
|
||||||
|
Logo string `json:"logo,omitempty"`
|
||||||
|
// Name of the computing
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Owner string `json:"owner,omitempty"`
|
||||||
|
Price int32 `json:"price,omitempty"`
|
||||||
|
Repository *ModelsRepositoryModel `json:"repository,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description,omitempty"`
|
||||||
|
Type_ string `json:"type,omitempty"`
|
||||||
|
}
|
27
api-client/oc-catalog/model_models_computing_new_model.go
Normal file
27
api-client/oc-catalog/model_models_computing_new_model.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsComputingNewModel struct {
|
||||||
|
Dinputs []string `json:"Dinputs,omitempty"`
|
||||||
|
Doutputs []string `json:"Doutputs,omitempty"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
ExecutionRequirements *ModelsExecutionRequirementsModel `json:"execution_requirements,omitempty"`
|
||||||
|
License string `json:"license,omitempty"`
|
||||||
|
Logo string `json:"logo"`
|
||||||
|
// Name of the computing
|
||||||
|
Name string `json:"name"`
|
||||||
|
Owner string `json:"owner,omitempty"`
|
||||||
|
Price int32 `json:"price,omitempty"`
|
||||||
|
Repository *ModelsRepositoryModel `json:"repository,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description"`
|
||||||
|
Type_ string `json:"type"`
|
||||||
|
}
|
20
api-client/oc-catalog/model_models_computing_object.go
Normal file
20
api-client/oc-catalog/model_models_computing_object.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsComputingObject struct {
|
||||||
|
// Datacenter where the computing will be executed
|
||||||
|
DatacenterID string `json:"datacenterID,omitempty"`
|
||||||
|
Inputs []string `json:"inputs,omitempty"`
|
||||||
|
Outputs []string `json:"outputs,omitempty"`
|
||||||
|
// Computing model ID
|
||||||
|
ReferenceID *PrimitiveObjectId `json:"referenceID,omitempty"`
|
||||||
|
}
|
20
api-client/oc-catalog/model_models_d_cstatus.go
Normal file
20
api-client/oc-catalog/model_models_d_cstatus.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDCstatus struct {
|
||||||
|
Booked *ModelsScheduleInfo `json:"Booked,omitempty"`
|
||||||
|
DCname string `json:"DCname,omitempty"`
|
||||||
|
DCobjID string `json:"DCobjID,omitempty"`
|
||||||
|
ErrorMessage string `json:"ErrorMessage,omitempty"`
|
||||||
|
IsAvailable bool `json:"IsAvailable,omitempty"`
|
||||||
|
IsReachable bool `json:"IsReachable,omitempty"`
|
||||||
|
}
|
27
api-client/oc-catalog/model_models_data_model.go
Normal file
27
api-client/oc-catalog/model_models_data_model.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDataModel struct {
|
||||||
|
ID string `json:"ID"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Dtype string `json:"dtype,omitempty"`
|
||||||
|
// base64 encoded data
|
||||||
|
Example string `json:"example,omitempty"`
|
||||||
|
Location string `json:"location,omitempty"`
|
||||||
|
Logo string `json:"logo,omitempty"`
|
||||||
|
// Name of the data
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Protocol []string `json:"protocol,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description,omitempty"`
|
||||||
|
// Define type of data
|
||||||
|
Type_ string `json:"type,omitempty"`
|
||||||
|
}
|
26
api-client/oc-catalog/model_models_data_new_model.go
Normal file
26
api-client/oc-catalog/model_models_data_new_model.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDataNewModel struct {
|
||||||
|
Description string `json:"description"`
|
||||||
|
Dtype string `json:"dtype,omitempty"`
|
||||||
|
// base64 encoded data
|
||||||
|
Example string `json:"example"`
|
||||||
|
Location string `json:"location"`
|
||||||
|
Logo string `json:"logo"`
|
||||||
|
// Name of the data
|
||||||
|
Name string `json:"name"`
|
||||||
|
Protocol []string `json:"protocol,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description"`
|
||||||
|
// Define type of data
|
||||||
|
Type_ string `json:"type"`
|
||||||
|
}
|
16
api-client/oc-catalog/model_models_data_object.go
Normal file
16
api-client/oc-catalog/model_models_data_object.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDataObject struct {
|
||||||
|
// Data model ID
|
||||||
|
ReferenceID *PrimitiveObjectId `json:"referenceID,omitempty"`
|
||||||
|
}
|
19
api-client/oc-catalog/model_models_datacenter_cpu_model.go
Normal file
19
api-client/oc-catalog/model_models_datacenter_cpu_model.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDatacenterCpuModel struct {
|
||||||
|
Architecture string `json:"architecture,omitempty"`
|
||||||
|
Cores int32 `json:"cores"`
|
||||||
|
MinimumMemory int32 `json:"minimum_memory,omitempty"`
|
||||||
|
Platform string `json:"platform,omitempty"`
|
||||||
|
Shared bool `json:"shared,omitempty"`
|
||||||
|
}
|
19
api-client/oc-catalog/model_models_datacenter_gpu_model.go
Normal file
19
api-client/oc-catalog/model_models_datacenter_gpu_model.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDatacenterGpuModel struct {
|
||||||
|
CudaCores int32 `json:"cuda_cores,omitempty"`
|
||||||
|
// Units in MB
|
||||||
|
Memory int32 `json:"memory,omitempty"`
|
||||||
|
Model string `json:"model,omitempty"`
|
||||||
|
TensorCores int32 `json:"tensor_cores,omitempty"`
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDatacenterMemoryModel struct {
|
||||||
|
Ecc bool `json:"ecc,omitempty"`
|
||||||
|
// Units in MB
|
||||||
|
Size int32 `json:"size,omitempty"`
|
||||||
|
}
|
29
api-client/oc-catalog/model_models_datacenter_model.go
Normal file
29
api-client/oc-catalog/model_models_datacenter_model.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDatacenterModel struct {
|
||||||
|
ID string `json:"ID"`
|
||||||
|
// id of the DC
|
||||||
|
Acronym string `json:"acronym,omitempty"`
|
||||||
|
BookingPrice int64 `json:"bookingPrice,omitempty"`
|
||||||
|
Cpu *ModelsDatacenterCpuModel `json:"cpu,omitempty"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Gpu []ModelsDatacenterGpuModel `json:"gpu,omitempty"`
|
||||||
|
// list of host:port
|
||||||
|
Hosts []string `json:"hosts,omitempty"`
|
||||||
|
Logo string `json:"logo,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Owner string `json:"owner,omitempty"`
|
||||||
|
Ram *ModelsDatacenterMemoryModel `json:"ram,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description,omitempty"`
|
||||||
|
Type_ string `json:"type,omitempty"`
|
||||||
|
}
|
28
api-client/oc-catalog/model_models_datacenter_new_model.go
Normal file
28
api-client/oc-catalog/model_models_datacenter_new_model.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDatacenterNewModel struct {
|
||||||
|
// id of the DC
|
||||||
|
Acronym string `json:"acronym"`
|
||||||
|
BookingPrice int64 `json:"bookingPrice,omitempty"`
|
||||||
|
Cpu *ModelsDatacenterCpuModel `json:"cpu"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Gpu []ModelsDatacenterGpuModel `json:"gpu"`
|
||||||
|
// list of host:port
|
||||||
|
Hosts []string `json:"hosts"`
|
||||||
|
Logo string `json:"logo"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Owner string `json:"owner,omitempty"`
|
||||||
|
Ram *ModelsDatacenterMemoryModel `json:"ram"`
|
||||||
|
ShortDescription string `json:"short_description"`
|
||||||
|
Type_ string `json:"type"`
|
||||||
|
}
|
16
api-client/oc-catalog/model_models_datacenter_object.go
Normal file
16
api-client/oc-catalog/model_models_datacenter_object.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsDatacenterObject struct {
|
||||||
|
// Data model ID
|
||||||
|
ReferenceID *PrimitiveObjectId `json:"referenceID,omitempty"`
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsExecutionRequirementsModel struct {
|
||||||
|
Cpus int32 `json:"cpus"`
|
||||||
|
DiskIo string `json:"disk_io,omitempty"`
|
||||||
|
// Amount of GPUs needed
|
||||||
|
Gpus int32 `json:"gpus,omitempty"`
|
||||||
|
Parallel bool `json:"parallel,omitempty"`
|
||||||
|
// Units in MB
|
||||||
|
Ram int32 `json:"ram"`
|
||||||
|
ScalingModel int32 `json:"scaling_model,omitempty"`
|
||||||
|
}
|
16
api-client/oc-catalog/model_models_repository_model.go
Normal file
16
api-client/oc-catalog/model_models_repository_model.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsRepositoryModel struct {
|
||||||
|
Credentials string `json:"credentials,omitempty"`
|
||||||
|
Url string `json:"url,omitempty"`
|
||||||
|
}
|
18
api-client/oc-catalog/model_models_schedule_db.go
Normal file
18
api-client/oc-catalog/model_models_schedule_db.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsScheduleDb struct {
|
||||||
|
ResourceQty *ModelsExecutionRequirementsModel `json:"ResourceQty,omitempty"`
|
||||||
|
StartDate string `json:"StartDate,omitempty"`
|
||||||
|
StopDate string `json:"StopDate,omitempty"`
|
||||||
|
Workflow string `json:"Workflow,omitempty"`
|
||||||
|
}
|
16
api-client/oc-catalog/model_models_schedule_info.go
Normal file
16
api-client/oc-catalog/model_models_schedule_info.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsScheduleInfo struct {
|
||||||
|
NextExecutions []string `json:"NextExecutions,omitempty"`
|
||||||
|
Total int64 `json:"Total,omitempty"`
|
||||||
|
}
|
14
api-client/oc-catalog/model_models_schedule_time.go
Normal file
14
api-client/oc-catalog/model_models_schedule_time.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsScheduleTime struct {
|
||||||
|
}
|
18
api-client/oc-catalog/model_models_search_result.go
Normal file
18
api-client/oc-catalog/model_models_search_result.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsSearchResult struct {
|
||||||
|
Computing []ModelsComputingModel `json:"computing"`
|
||||||
|
Data []ModelsDataModel `json:"data,omitempty"`
|
||||||
|
Datacenter []ModelsDatacenterModel `json:"datacenter,omitempty"`
|
||||||
|
Storage []ModelsStorageModel `json:"storage,omitempty"`
|
||||||
|
}
|
27
api-client/oc-catalog/model_models_storage_model.go
Normal file
27
api-client/oc-catalog/model_models_storage_model.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsStorageModel struct {
|
||||||
|
// Unique ID of the DC where it is the storage
|
||||||
|
DCacronym string `json:"DCacronym,omitempty"`
|
||||||
|
ID string `json:"ID"`
|
||||||
|
BookingPrice int32 `json:"bookingPrice,omitempty"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
|
Encryption bool `json:"encryption,omitempty"`
|
||||||
|
Logo string `json:"logo,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
Redundancy string `json:"redundancy,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description,omitempty"`
|
||||||
|
Size int32 `json:"size,omitempty"`
|
||||||
|
Throughput string `json:"throughput,omitempty"`
|
||||||
|
Type_ string `json:"type,omitempty"`
|
||||||
|
}
|
26
api-client/oc-catalog/model_models_storage_new_model.go
Normal file
26
api-client/oc-catalog/model_models_storage_new_model.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsStorageNewModel struct {
|
||||||
|
// Unique ID of the DC where it is the storage
|
||||||
|
DCacronym string `json:"DCacronym"`
|
||||||
|
BookingPrice int32 `json:"bookingPrice,omitempty"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Encryption bool `json:"encryption,omitempty"`
|
||||||
|
Logo string `json:"logo"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Redundancy string `json:"redundancy,omitempty"`
|
||||||
|
ShortDescription string `json:"short_description"`
|
||||||
|
Size int32 `json:"size"`
|
||||||
|
Throughput string `json:"throughput,omitempty"`
|
||||||
|
Type_ string `json:"type"`
|
||||||
|
}
|
18
api-client/oc-catalog/model_models_storage_object.go
Normal file
18
api-client/oc-catalog/model_models_storage_object.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsStorageObject struct {
|
||||||
|
Inputs []string `json:"inputs,omitempty"`
|
||||||
|
Outputs []string `json:"outputs,omitempty"`
|
||||||
|
// Storage model ID
|
||||||
|
ReferenceID *PrimitiveObjectId `json:"referenceID,omitempty"`
|
||||||
|
}
|
21
api-client/oc-catalog/model_models_workflow.go
Normal file
21
api-client/oc-catalog/model_models_workflow.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsWorkflow struct {
|
||||||
|
// State of the mxgraph
|
||||||
|
MxgraphXML string `json:"MxgraphXML,omitempty"`
|
||||||
|
Computing *ModelsComputingObject `json:"computing,omitempty"`
|
||||||
|
Data *ModelsDataObject `json:"data,omitempty"`
|
||||||
|
Datacenter *ModelsDatacenterObject `json:"datacenter,omitempty"`
|
||||||
|
Schedules *ModelsWorkflowSchedule `json:"schedules,omitempty"`
|
||||||
|
Storage *ModelsStorageObject `json:"storage,omitempty"`
|
||||||
|
}
|
23
api-client/oc-catalog/model_models_workflow_schedule.go
Normal file
23
api-client/oc-catalog/model_models_workflow_schedule.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsWorkflowSchedule struct {
|
||||||
|
// Service: true, Task: false
|
||||||
|
IsService bool `json:"IsService,omitempty"`
|
||||||
|
StartDate string `json:"StartDate,omitempty"`
|
||||||
|
StopDate string `json:"StopDate,omitempty"`
|
||||||
|
Cron string `json:"cron,omitempty"`
|
||||||
|
// Durantion in seconds
|
||||||
|
Duration int32 `json:"duration,omitempty"`
|
||||||
|
Events string `json:"events,omitempty"`
|
||||||
|
IsBooked bool `json:"isBooked,omitempty"`
|
||||||
|
}
|
20
api-client/oc-catalog/model_models_workspace.go
Normal file
20
api-client/oc-catalog/model_models_workspace.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsWorkspace struct {
|
||||||
|
Workflows *ModelsWorkflow `json:"Workflows,omitempty"`
|
||||||
|
Computing []string `json:"computing,omitempty"`
|
||||||
|
Data []string `json:"data,omitempty"`
|
||||||
|
Datacenter []string `json:"datacenter,omitempty"`
|
||||||
|
Storage []string `json:"storage,omitempty"`
|
||||||
|
UserId string `json:"user_id,omitempty"`
|
||||||
|
}
|
19
api-client/oc-catalog/model_models_workspace_model.go
Normal file
19
api-client/oc-catalog/model_models_workspace_model.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type ModelsWorkspaceModel struct {
|
||||||
|
Computing []ModelsComputingModel `json:"computing,omitempty"`
|
||||||
|
Data []ModelsDataModel `json:"data,omitempty"`
|
||||||
|
Datacenter []ModelsDatacenterModel `json:"datacenter,omitempty"`
|
||||||
|
Storage []ModelsStorageModel `json:"storage,omitempty"`
|
||||||
|
UserId string `json:"user_id,omitempty"`
|
||||||
|
}
|
14
api-client/oc-catalog/model_primitive_object_id.go
Normal file
14
api-client/oc-catalog/model_primitive_object_id.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type PrimitiveObjectId struct {
|
||||||
|
}
|
14
api-client/oc-catalog/model_time_time.go
Normal file
14
api-client/oc-catalog/model_time_time.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
type TimeTime struct {
|
||||||
|
}
|
44
api-client/oc-catalog/response.go
Normal file
44
api-client/oc-catalog/response.go
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* oc-catalog API
|
||||||
|
*
|
||||||
|
* Backend of the oc-search project
|
||||||
|
*
|
||||||
|
* API version: 1.0.0
|
||||||
|
* Contact: valentin.kivachuk@irt-saintexupery.com
|
||||||
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIResponse struct {
|
||||||
|
*http.Response `json:"-"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
// Operation is the name of the swagger operation.
|
||||||
|
Operation string `json:"operation,omitempty"`
|
||||||
|
// RequestURL is the request URL. This value is always available, even if the
|
||||||
|
// embedded *http.Response is nil.
|
||||||
|
RequestURL string `json:"url,omitempty"`
|
||||||
|
// Method is the HTTP method used for the request. This value is always
|
||||||
|
// available, even if the embedded *http.Response is nil.
|
||||||
|
Method string `json:"method,omitempty"`
|
||||||
|
// Payload holds the contents of the response body (which may be nil or empty).
|
||||||
|
// This is provided here as the raw response.Body() reader will have already
|
||||||
|
// been drained.
|
||||||
|
Payload []byte `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIResponse(r *http.Response) *APIResponse {
|
||||||
|
|
||||||
|
response := &APIResponse{Response: r}
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIResponseWithError(errorMessage string) *APIResponse {
|
||||||
|
|
||||||
|
response := &APIResponse{Message: errorMessage}
|
||||||
|
return response
|
||||||
|
}
|
5
conf/app.conf
Normal file
5
conf/app.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
appname = search
|
||||||
|
httpport = 8080
|
||||||
|
runmode = dev
|
||||||
|
|
||||||
|
EnableDocs = true
|
21
controllers/datacenter.go
Normal file
21
controllers/datacenter.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DatacenterController is the controller in chrage of solr
|
||||||
|
type DatacenterController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare checks for logged in Datacenter
|
||||||
|
func (c *DatacenterController) Prepare() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get implements simple solr Datacenter
|
||||||
|
func (c *DatacenterController) Get() {
|
||||||
|
|
||||||
|
c.TplName = "datacenter.tpl"
|
||||||
|
}
|
31
controllers/default.go
Normal file
31
controllers/default.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
OCCatalog_cli "oc-search/api-client/oc-catalog"
|
||||||
|
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MainController is in charge of the main page
|
||||||
|
type MainController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
var OCCatalogAPI *OCCatalog_cli.APIClient
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// auth := context.WithValue(context.Background(), OCCatalog_cli.ContextAPIKey, OCCatalog_cli.APIKey{Key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE2MTI1OTI3MDIsInVzZXJfaWQiOiJ4ZCJ9.kTLb1FtpdnaobUpe5u9Jw8S7Cc6gf7ExmU4U3XMcC2o"})
|
||||||
|
OCCatalogAPI = OCCatalog_cli.NewAPIClient(&OCCatalog_cli.Configuration{BasePath: "http://localhost:49618/v1",
|
||||||
|
DefaultHeader: map[string]string{
|
||||||
|
"authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE2MTMwMDI0NjAsInVzZXJfaWQiOiJhc2QifQ.TXT18aeulnCrtedKKFVaD0BapOTdVAFcJJdVS7zk0I8",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
//TODO: Test API is reachable or throw exception
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get provides the main page
|
||||||
|
func (c *MainController) Get() {
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "index.tpl"
|
||||||
|
}
|
74
controllers/details.go
Normal file
74
controllers/details.go
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DetailsController is the controller in chrage of solr
|
||||||
|
type DetailsController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title GetDetails
|
||||||
|
// @Description Return details of a resource
|
||||||
|
// @Success 200 {string} Cool
|
||||||
|
// @router /data/:id [post]
|
||||||
|
// @router /computing/:id [post]
|
||||||
|
// @router /storage/:id [post]
|
||||||
|
// @router /datacenter/:id [post]
|
||||||
|
func (c *DetailsController) SubmitToWorkspace(id string) {
|
||||||
|
rType := c.Ctx.Input.Params()["1"]
|
||||||
|
|
||||||
|
var err error
|
||||||
|
|
||||||
|
switch rType {
|
||||||
|
case "data":
|
||||||
|
case "computing":
|
||||||
|
case "datacenter":
|
||||||
|
case "storage":
|
||||||
|
_, err = OCCatalogAPI.WorkspaceApi.WorkspaceControllerAddModelToWorkspace(context.Background(), id, rType)
|
||||||
|
default:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title GetDetails
|
||||||
|
// @Description Return details of a resource
|
||||||
|
// @Success 200 {string} Cool
|
||||||
|
// @router /data/:id [get]
|
||||||
|
// @router /computing/:id [get]
|
||||||
|
// @router /storage/:id [get]
|
||||||
|
// @router /datacenter/:id [get]
|
||||||
|
func (c *DetailsController) GetElementInfo(id string) {
|
||||||
|
rType := c.Ctx.Input.Params()["1"]
|
||||||
|
|
||||||
|
var res interface{}
|
||||||
|
var err error
|
||||||
|
|
||||||
|
switch rType {
|
||||||
|
case "data":
|
||||||
|
res, _, err = OCCatalogAPI.DataApi.DataControllerGetDataByID(context.Background(), id)
|
||||||
|
case "computing":
|
||||||
|
res, _, err = OCCatalogAPI.ComputingApi.ComputingControllerGetComputingByID(context.Background(), id)
|
||||||
|
case "datacenter":
|
||||||
|
res, _, err = OCCatalogAPI.DatacenterApi.DatacenterControllerGetOneDatacenter(context.Background(), id)
|
||||||
|
case "storage":
|
||||||
|
res, _, err = OCCatalogAPI.StorageApi.StorageControllerGet(context.Background(), id)
|
||||||
|
default:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Data["data"] = res
|
||||||
|
c.TplName = "details.tpl"
|
||||||
|
}
|
28
controllers/item.go
Normal file
28
controllers/item.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ItemController shows partners on a map
|
||||||
|
type ItemController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get items
|
||||||
|
func (c *ItemController) Get() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "item.tpl"
|
||||||
|
c.EnableXSRF = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add item
|
||||||
|
func (c *ItemController) Add() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "item_add.tpl"
|
||||||
|
c.EnableXSRF = false
|
||||||
|
}
|
17
controllers/login.go
Normal file
17
controllers/login.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// LoginController is the controller in chrage of solr
|
||||||
|
type LoginController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get implements simple solr Login
|
||||||
|
func (c *LoginController) Get() {
|
||||||
|
|
||||||
|
c.TplName = "login.tpl"
|
||||||
|
//c.SetSession("login", "test")
|
||||||
|
}
|
19
controllers/map.go
Normal file
19
controllers/map.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MapController shows partners on a map
|
||||||
|
type MapController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get i
|
||||||
|
func (c *MapController) Get() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "map.tpl"
|
||||||
|
c.EnableXSRF = false
|
||||||
|
}
|
21
controllers/networks.go
Normal file
21
controllers/networks.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NetworksController is the controller in chrage of solr
|
||||||
|
type NetworksController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get implements simple search
|
||||||
|
func (c *NetworksController) Get() {
|
||||||
|
resources := loadSingleFile("data/test.json")
|
||||||
|
fmt.Println(len(resources))
|
||||||
|
fmt.Println(resources[0].Name)
|
||||||
|
c.Data["list"] = resources
|
||||||
|
c.TplName = "networks.tpl"
|
||||||
|
}
|
96
controllers/oidc.go
Normal file
96
controllers/oidc.go
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
|
||||||
|
oidc "github.com/coreos/go-oidc"
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
"golang.org/x/oauth2"
|
||||||
|
)
|
||||||
|
|
||||||
|
// OidcController is the controller in oidc
|
||||||
|
type OidcController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
var oauth2Config oauth2.Config
|
||||||
|
var idTokenVerifier *oidc.IDTokenVerifier
|
||||||
|
var ctx context.Context
|
||||||
|
|
||||||
|
// Connect implements open id connection to openid provider
|
||||||
|
func (c *OidcController) Connect() {
|
||||||
|
ctx = context.Background()
|
||||||
|
|
||||||
|
// Initialize a provider by specifying dex's issuer URL.
|
||||||
|
provider, err := oidc.NewProvider(ctx, "http://127.0.0.1:5556/dex")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure the OAuth2 config with the client values.
|
||||||
|
oauth2Config = oauth2.Config{
|
||||||
|
// client_id and client_secret of the client.
|
||||||
|
ClientID: "opencloud-search",
|
||||||
|
ClientSecret: "ZXhhbXBsZS1hcHAtc2VjcmV0",
|
||||||
|
|
||||||
|
// The redirectURL.
|
||||||
|
RedirectURL: "http://127.0.0.1:8080/oidc-callback",
|
||||||
|
|
||||||
|
// Discovery returns the OAuth2 endpoints.
|
||||||
|
Endpoint: provider.Endpoint(),
|
||||||
|
|
||||||
|
// "openid" is a required scope for OpenID Connect flows.
|
||||||
|
//
|
||||||
|
// Other scopes, such as "groups" can be requested.
|
||||||
|
Scopes: []string{oidc.ScopeOpenID, "profile", "email", "groups"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create an ID token parser.
|
||||||
|
idTokenVerifier = provider.Verifier(&oidc.Config{ClientID: "opencloud-search"})
|
||||||
|
|
||||||
|
//state := newState()
|
||||||
|
c.Redirect(oauth2Config.AuthCodeURL("foobar"), http.StatusFound)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Callback implements open id callback from openid provider
|
||||||
|
func (c *OidcController) Callback() {
|
||||||
|
|
||||||
|
state := c.GetString("state")
|
||||||
|
code := c.GetString("code")
|
||||||
|
_ = state
|
||||||
|
// Verify state.
|
||||||
|
|
||||||
|
oauth2Token, err := oauth2Config.Exchange(ctx, code)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract the ID Token from OAuth2 token.
|
||||||
|
rawIDToken, ok := oauth2Token.Extra("id_token").(string)
|
||||||
|
if !ok {
|
||||||
|
// handle missing token
|
||||||
|
}
|
||||||
|
fmt.Println(rawIDToken)
|
||||||
|
// Parse and verify ID Token payload.
|
||||||
|
idToken, err := idTokenVerifier.Verify(ctx, rawIDToken)
|
||||||
|
if err != nil {
|
||||||
|
// handle error
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract custom claims.
|
||||||
|
var claims struct {
|
||||||
|
Email string `json:"email"`
|
||||||
|
Verified bool `json:"email_verified"`
|
||||||
|
Groups []string `json:"groups"`
|
||||||
|
}
|
||||||
|
if err := idToken.Claims(&claims); err != nil {
|
||||||
|
// handle error
|
||||||
|
}
|
||||||
|
c.SetSession("login", claims.Email)
|
||||||
|
c.Redirect("/user", http.StatusFound)
|
||||||
|
}
|
28
controllers/partner.go
Normal file
28
controllers/partner.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PartnerController shows partners on a map
|
||||||
|
type PartnerController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get i
|
||||||
|
func (c *PartnerController) Get() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "item.tpl"
|
||||||
|
c.EnableXSRF = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add i
|
||||||
|
func (c *PartnerController) Add() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "map.tpl"
|
||||||
|
c.EnableXSRF = false
|
||||||
|
}
|
15
controllers/schedule.go
Normal file
15
controllers/schedule.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ScheduleController is the controller in chrage of solr
|
||||||
|
type ScheduleController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get implements simple search
|
||||||
|
func (c *ScheduleController) Get() {
|
||||||
|
c.TplName = "schedule.tpl"
|
||||||
|
}
|
53
controllers/search.go
Normal file
53
controllers/search.go
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
OCCatalog_cli "oc-search/api-client/oc-catalog"
|
||||||
|
|
||||||
|
"github.com/beego/beego/v2/core/logs"
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
|
||||||
|
"oc-search/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SearchController is the controller in chrage of solr
|
||||||
|
type SearchController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
func loadSingleFile(filename string) []models.Resource {
|
||||||
|
var list []models.Resource
|
||||||
|
jsonFile, err := os.Open(filename)
|
||||||
|
// if we os.Open returns an error then handle it
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
defer jsonFile.Close()
|
||||||
|
byteValue, _ := ioutil.ReadAll(jsonFile)
|
||||||
|
json.Unmarshal(byteValue, &list)
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get implements simple search
|
||||||
|
func (c *SearchController) Get() {
|
||||||
|
query := c.GetString("q")
|
||||||
|
|
||||||
|
var resources OCCatalog_cli.ModelsSearchResult
|
||||||
|
|
||||||
|
//FIXME: dashboard special case for x_dash.json ?????
|
||||||
|
resources, _, err := OCCatalogAPI.SearchApi.SearchControllerSearchByWord(context.Background(), query)
|
||||||
|
if err != nil {
|
||||||
|
logs.Warn(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: Adapt the View and models to use the OCCatalog_cli models as much as possible
|
||||||
|
|
||||||
|
c.Data["list"] = resources
|
||||||
|
c.TplName = "search.tpl"
|
||||||
|
}
|
25
controllers/user.go
Normal file
25
controllers/user.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UserController is the controller in chrage of solr
|
||||||
|
type UserController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare checks for logged in User
|
||||||
|
func (c *UserController) Prepare() {
|
||||||
|
login, _ := c.GetSession("login").(string)
|
||||||
|
if login == "" {
|
||||||
|
c.Ctx.Redirect(302, "/login")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get implements simple solr User
|
||||||
|
func (c *UserController) Get() {
|
||||||
|
c.Data["login"], _ = c.GetSession("login").(string)
|
||||||
|
c.TplName = "user.tpl"
|
||||||
|
}
|
81
controllers/workflow.go
Normal file
81
controllers/workflow.go
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
"github.com/sbabiv/xml2map"
|
||||||
|
)
|
||||||
|
|
||||||
|
// WorkflowController allows to edit a tasks workflow
|
||||||
|
type WorkflowController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get i
|
||||||
|
func (c *WorkflowController) Get() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "workflow.tpl"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open i
|
||||||
|
func (c *WorkflowController) Open() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "workflow.tpl"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save i
|
||||||
|
func (c *WorkflowController) Save() {
|
||||||
|
xml := c.GetString("xml")
|
||||||
|
fmt.Println(xml)
|
||||||
|
decodedValue, err := url.QueryUnescape(xml)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(decodedValue)
|
||||||
|
os.WriteFile("graph.xml", []byte(decodedValue), 0660)
|
||||||
|
decoder := xml2map.NewDecoder(strings.NewReader(decodedValue))
|
||||||
|
result, err := decoder.Decode()
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
cells := result["mxGraphModel"].(map[string]interface{})["root"].(map[string]interface{})["mxCell"].([]map[string]interface{})
|
||||||
|
|
||||||
|
for _, element := range cells {
|
||||||
|
id := element["@id"].(string)
|
||||||
|
if _, ok := element["@style"]; ok {
|
||||||
|
if _, ok2 := element["@rID"]; ok2 {
|
||||||
|
fmt.Print(id + ": ")
|
||||||
|
fmt.Println(element["@rID"], element["@rType"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if src, ok := element["@source"]; ok {
|
||||||
|
src = element["@source"].(string)
|
||||||
|
fmt.Println("Link: " + src.(string) + " " + element["@target"].(string))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.StopRun()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export i
|
||||||
|
func (c *WorkflowController) Export() {
|
||||||
|
|
||||||
|
c.Data["Website"] = "beego.me"
|
||||||
|
c.Data["Email"] = "astaxie@gmail.com"
|
||||||
|
c.TplName = "workflow.tpl"
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user