-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from croomes/dev-v2
Initial v2 api
- Loading branch information
Showing
77 changed files
with
16,186 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# 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 OpenAPI Generator 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.3.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: go | ||
|
||
install: | ||
- go get -d -v . | ||
|
||
script: | ||
- go build -v ./ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2015-2020 StorageOS | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
VERSION ?= 2.0.0-rc1 | ||
GIT_USER_ID ?= storageos | ||
GIT_REPO_ID ?= go-api | ||
|
||
.DEFAULT_GOAL:=help | ||
|
||
.PHONY: help customise | ||
|
||
help: ## Display this help. | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-13s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) | ||
|
||
build: generate customise ## Re-generates the API from openapi.yaml. | ||
|
||
generate: ## Runs the openapi-generator on openapi.yaml. | ||
docker run --rm -v `pwd`:/local -u `id -u ${USER}`:`id -g ${USER}` \ | ||
openapitools/openapi-generator-cli:latest generate \ | ||
--strict-spec=true \ | ||
--additional-properties enumClassPrefix=true \ | ||
--additional-properties packageName=api \ | ||
--additional-properties packageVersion=$(VERSION) \ | ||
-i /local/openapi.yaml -g go -o /local | ||
|
||
customise: ## Applies customisations to the generated API. | ||
sed -i 's/\[]map/map/ig' *.go | ||
sed -i "s#module github.com/GIT_USER_ID/GIT_REPO_ID#module github.com/${GIT_USER_ID}/${GIT_REPO_ID}/v2#g" go.mod | ||
|
||
clean: ## Removes generated files. | ||
rm -f .openapi-generator-ignore .gitignore git_push.sh .travis.yml *.go go.mod go.sum | ||
rm -rf .openapi-generator/ api/ docs/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Go API client for api | ||
|
||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
|
||
## Overview | ||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. | ||
|
||
- API version: 2.0.0 | ||
- Package version: 2.0.0-rc1 | ||
- Build package: org.openapitools.codegen.languages.GoClientCodegen | ||
For more information, please visit [https://storageos.com](https://storageos.com) | ||
|
||
## Installation | ||
|
||
Install the following dependencies: | ||
|
||
```shell | ||
go get github.com/stretchr/testify/assert | ||
go get golang.org/x/oauth2 | ||
go get golang.org/x/net/context | ||
go get github.com/antihax/optional | ||
``` | ||
|
||
Put the package under your project folder and add the following in import: | ||
|
||
```golang | ||
import "./api" | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http://localhost/v2* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*DefaultApi* | [**AttachVolume**](docs/DefaultApi.md#attachvolume) | **Post** /namespaces/{namespaceID}/volumes/{id}/attach | Attach a volume to the given node | ||
*DefaultApi* | [**AuthenticateUser**](docs/DefaultApi.md#authenticateuser) | **Post** /auth/login | Authenticate a user | ||
*DefaultApi* | [**CreateNamespace**](docs/DefaultApi.md#createnamespace) | **Post** /namespaces | Create a new namespace | ||
*DefaultApi* | [**CreatePolicyGroup**](docs/DefaultApi.md#createpolicygroup) | **Post** /policies | Create a new policy group | ||
*DefaultApi* | [**CreateUser**](docs/DefaultApi.md#createuser) | **Post** /users | Create a new user | ||
*DefaultApi* | [**CreateVolume**](docs/DefaultApi.md#createvolume) | **Post** /namespaces/{namespaceID}/volumes | Create a new Volume in the specified namespace | ||
*DefaultApi* | [**DeleteAuthenticatedUser**](docs/DefaultApi.md#deleteauthenticateduser) | **Delete** /users/self | Delete the authenticated user | ||
*DefaultApi* | [**DeleteAuthenticatedUserSessions**](docs/DefaultApi.md#deleteauthenticatedusersessions) | **Delete** /users/self/sessions | Invalidate the logged in user's sessions | ||
*DefaultApi* | [**DeleteNamespace**](docs/DefaultApi.md#deletenamespace) | **Delete** /namespaces/{id} | Delete a namespace | ||
*DefaultApi* | [**DeleteNode**](docs/DefaultApi.md#deletenode) | **Delete** /nodes/{id} | Delete a node | ||
*DefaultApi* | [**DeletePolicyGroup**](docs/DefaultApi.md#deletepolicygroup) | **Delete** /policies/{id} | Delete a policy group | ||
*DefaultApi* | [**DeleteSessions**](docs/DefaultApi.md#deletesessions) | **Delete** /users/{id}/sessions | Invalidate login sessions | ||
*DefaultApi* | [**DeleteUser**](docs/DefaultApi.md#deleteuser) | **Delete** /users/{id} | Delete a user | ||
*DefaultApi* | [**DeleteVolume**](docs/DefaultApi.md#deletevolume) | **Delete** /namespaces/{namespaceID}/volumes/{id} | Delete a volume | ||
*DefaultApi* | [**DetachVolume**](docs/DefaultApi.md#detachvolume) | **Delete** /namespaces/{namespaceID}/volumes/{id}/attach | Detach the given volume | ||
*DefaultApi* | [**GetAuthenticatedUser**](docs/DefaultApi.md#getauthenticateduser) | **Get** /users/self | Get the currently authenticated user's information | ||
*DefaultApi* | [**GetCluster**](docs/DefaultApi.md#getcluster) | **Get** /cluster | Retrieves the cluster's global configuration settings | ||
*DefaultApi* | [**GetDiagnostics**](docs/DefaultApi.md#getdiagnostics) | **Get** /diagnostics | Retrieves a diagnostics bundle from the target node | ||
*DefaultApi* | [**GetNamespace**](docs/DefaultApi.md#getnamespace) | **Get** /namespaces/{id} | Fetch a namespace | ||
*DefaultApi* | [**GetNode**](docs/DefaultApi.md#getnode) | **Get** /nodes/{id} | Fetch a node | ||
*DefaultApi* | [**GetPolicyGroup**](docs/DefaultApi.md#getpolicygroup) | **Get** /policies/{id} | Fetch a policy group | ||
*DefaultApi* | [**GetUser**](docs/DefaultApi.md#getuser) | **Get** /users/{id} | Fetch a user | ||
*DefaultApi* | [**GetVolume**](docs/DefaultApi.md#getvolume) | **Get** /namespaces/{namespaceID}/volumes/{id} | Fetch a volume | ||
*DefaultApi* | [**ListNamespaces**](docs/DefaultApi.md#listnamespaces) | **Get** /namespaces | Fetch the list of namespaces | ||
*DefaultApi* | [**ListNodes**](docs/DefaultApi.md#listnodes) | **Get** /nodes | Fetch the list of nodes | ||
*DefaultApi* | [**ListPolicyGroups**](docs/DefaultApi.md#listpolicygroups) | **Get** /policies | Fetch the list of policy groups | ||
*DefaultApi* | [**ListUsers**](docs/DefaultApi.md#listusers) | **Get** /users | Fetch the list of users | ||
*DefaultApi* | [**ListVolumes**](docs/DefaultApi.md#listvolumes) | **Get** /namespaces/{namespaceID}/volumes | Fetch the list of volumes in the given namespace | ||
*DefaultApi* | [**RefreshJwt**](docs/DefaultApi.md#refreshjwt) | **Post** /auth/refresh | Refresh the JWT | ||
*DefaultApi* | [**Spec**](docs/DefaultApi.md#spec) | **Get** /openapi | Serves this openapi spec file | ||
*DefaultApi* | [**UpdateAuthenticatedUser**](docs/DefaultApi.md#updateauthenticateduser) | **Put** /users/self | Update the authenticated user's information | ||
*DefaultApi* | [**UpdateCluster**](docs/DefaultApi.md#updatecluster) | **Put** /cluster | Update the cluster's global configuration settings | ||
*DefaultApi* | [**UpdateNamespace**](docs/DefaultApi.md#updatenamespace) | **Put** /namespaces/{id} | Update a namespace | ||
*DefaultApi* | [**UpdateNode**](docs/DefaultApi.md#updatenode) | **Put** /nodes/{id} | Update a node | ||
*DefaultApi* | [**UpdatePolicyGroup**](docs/DefaultApi.md#updatepolicygroup) | **Put** /policies/{id} | Update a policy group | ||
*DefaultApi* | [**UpdateUser**](docs/DefaultApi.md#updateuser) | **Put** /users/{id} | Update a user | ||
*DefaultApi* | [**UpdateVolume**](docs/DefaultApi.md#updatevolume) | **Put** /namespaces/{namespaceID}/volumes/{id} | Update a volume | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [AcceptedMessage](docs/AcceptedMessage.md) | ||
- [AttachVolumeData](docs/AttachVolumeData.md) | ||
- [AuthUserData](docs/AuthUserData.md) | ||
- [Cluster](docs/Cluster.md) | ||
- [CreateNamespaceData](docs/CreateNamespaceData.md) | ||
- [CreatePolicyGroupData](docs/CreatePolicyGroupData.md) | ||
- [CreateUserData](docs/CreateUserData.md) | ||
- [CreateVolumeData](docs/CreateVolumeData.md) | ||
- [DeploymentInfo](docs/DeploymentInfo.md) | ||
- [Error](docs/Error.md) | ||
- [FsType](docs/FsType.md) | ||
- [Health](docs/Health.md) | ||
- [Licence](docs/Licence.md) | ||
- [LogFormat](docs/LogFormat.md) | ||
- [LogLevel](docs/LogLevel.md) | ||
- [Namespace](docs/Namespace.md) | ||
- [Node](docs/Node.md) | ||
- [PoliciesSpecs](docs/PoliciesSpecs.md) | ||
- [PolicyGroup](docs/PolicyGroup.md) | ||
- [PolicyGroupUsers](docs/PolicyGroupUsers.md) | ||
- [UpdateAuthenticatedUserData](docs/UpdateAuthenticatedUserData.md) | ||
- [UpdateClusterData](docs/UpdateClusterData.md) | ||
- [UpdateNamespaceData](docs/UpdateNamespaceData.md) | ||
- [UpdateNodeData](docs/UpdateNodeData.md) | ||
- [UpdatePolicyGroupData](docs/UpdatePolicyGroupData.md) | ||
- [UpdateUserData](docs/UpdateUserData.md) | ||
- [UpdateVolumeData](docs/UpdateVolumeData.md) | ||
- [User](docs/User.md) | ||
- [Volume](docs/Volume.md) | ||
|
||
|
||
## Documentation For Authorization | ||
|
||
|
||
|
||
## jwt | ||
|
||
- **Type**: HTTP basic authentication | ||
|
||
Example | ||
|
||
```golang | ||
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ | ||
UserName: "username", | ||
Password: "password", | ||
}) | ||
r, err := client.Service.Operation(auth, args) | ||
``` | ||
|
||
|
||
|
||
## Author | ||
|
||
[email protected] | ||
|
Oops, something went wrong.