client

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRestURL

func GetRestURL(endPoint string) string

func IsHttpAccepted added in v0.1.1

func IsHttpAccepted(err error) bool

func IsHttpNotFound added in v0.2.0

func IsHttpNotFound(err error) bool

func IsHttpStatusCode added in v0.2.0

func IsHttpStatusCode(err error, statusCode int) bool

Types

type RookNetworkRestClient

type RookNetworkRestClient struct {
	RestURL    string
	HttpClient *http.Client
}

func NewRookNetworkRestClient

func NewRookNetworkRestClient(url string, httpClient *http.Client) *RookNetworkRestClient

func (*RookNetworkRestClient) CreateBlockImage

func (c *RookNetworkRestClient) CreateBlockImage(newImage model.BlockImage) (string, error)

func (*RookNetworkRestClient) CreateFilesystem added in v0.1.1

func (c *RookNetworkRestClient) CreateFilesystem(newFilesystem model.FilesystemRequest) (string, error)

func (*RookNetworkRestClient) CreateObjectStore added in v0.2.0

func (c *RookNetworkRestClient) CreateObjectStore(store model.ObjectStore) (string, error)

func (*RookNetworkRestClient) CreateObjectUser added in v0.3.0

func (c *RookNetworkRestClient) CreateObjectUser(storeName string, user model.ObjectUser) (*model.ObjectUser, error)

func (*RookNetworkRestClient) CreatePool

func (c *RookNetworkRestClient) CreatePool(newPool model.Pool) (string, error)

func (*RookNetworkRestClient) DeleteBlockImage added in v0.3.1

func (c *RookNetworkRestClient) DeleteBlockImage(image model.BlockImage) (string, error)

func (*RookNetworkRestClient) DeleteBucket added in v0.5.0

func (c *RookNetworkRestClient) DeleteBucket(storeName, bucketName string, purge bool) error

func (*RookNetworkRestClient) DeleteFilesystem added in v0.1.1

func (c *RookNetworkRestClient) DeleteFilesystem(deleteFilesystem model.FilesystemRequest) (string, error)

func (*RookNetworkRestClient) DeleteObjectStore added in v0.6.0

func (c *RookNetworkRestClient) DeleteObjectStore(storeName string) error

func (*RookNetworkRestClient) DeleteObjectUser added in v0.3.0

func (c *RookNetworkRestClient) DeleteObjectUser(storeName, id string) error

func (*RookNetworkRestClient) DeletePool added in v0.6.0

func (c *RookNetworkRestClient) DeletePool(name string) error

func (*RookNetworkRestClient) Do

func (a *RookNetworkRestClient) Do(method, query string, body io.Reader) ([]byte, error)

func (*RookNetworkRestClient) DoDelete added in v0.3.0

func (a *RookNetworkRestClient) DoDelete(query string) ([]byte, error)

func (*RookNetworkRestClient) DoGet

func (a *RookNetworkRestClient) DoGet(query string) ([]byte, error)

func (*RookNetworkRestClient) DoPost

func (a *RookNetworkRestClient) DoPost(query string, body io.Reader) ([]byte, error)

func (*RookNetworkRestClient) DoPut added in v0.3.0

func (a *RookNetworkRestClient) DoPut(query string, body io.Reader) ([]byte, error)

func (*RookNetworkRestClient) GetBlockImages

func (c *RookNetworkRestClient) GetBlockImages() ([]model.BlockImage, error)

func (*RookNetworkRestClient) GetBucket added in v0.5.0

func (c *RookNetworkRestClient) GetBucket(storeName, bucketName string) (*model.ObjectBucket, error)

func (*RookNetworkRestClient) GetClientAccessInfo added in v0.1.1

func (c *RookNetworkRestClient) GetClientAccessInfo() (model.ClientAccessInfo, error)

func (*RookNetworkRestClient) GetFilesystems added in v0.1.1

func (c *RookNetworkRestClient) GetFilesystems() ([]model.Filesystem, error)

func (*RookNetworkRestClient) GetNodes

func (a *RookNetworkRestClient) GetNodes() ([]model.Node, error)

func (*RookNetworkRestClient) GetObjectStoreConnectionInfo added in v0.2.0

func (c *RookNetworkRestClient) GetObjectStoreConnectionInfo(storeName string) (*model.ObjectStoreConnectInfo, error)

func (*RookNetworkRestClient) GetObjectStores added in v0.6.0

func (c *RookNetworkRestClient) GetObjectStores() ([]model.ObjectStoreResponse, error)

func (*RookNetworkRestClient) GetObjectUser added in v0.3.0

func (c *RookNetworkRestClient) GetObjectUser(storeName, id string) (*model.ObjectUser, error)

func (*RookNetworkRestClient) GetPools

func (c *RookNetworkRestClient) GetPools() ([]model.Pool, error)

func (*RookNetworkRestClient) GetStatusDetails

func (a *RookNetworkRestClient) GetStatusDetails() (model.StatusDetails, error)

func (*RookNetworkRestClient) ListBuckets added in v0.3.0

func (c *RookNetworkRestClient) ListBuckets(storeName string) ([]model.ObjectBucket, error)

func (*RookNetworkRestClient) ListObjectUsers added in v0.3.0

func (c *RookNetworkRestClient) ListObjectUsers(storeName string) ([]model.ObjectUser, error)

func (*RookNetworkRestClient) URL

func (a *RookNetworkRestClient) URL() string

func (*RookNetworkRestClient) UpdateObjectUser added in v0.3.0

func (c *RookNetworkRestClient) UpdateObjectUser(storeName string, user model.ObjectUser) (*model.ObjectUser, error)

type RookRestClient

type RookRestClient interface {
	URL() string
	GetNodes() ([]model.Node, error)
	GetPools() ([]model.Pool, error)
	CreatePool(pool model.Pool) (string, error)
	DeletePool(name string) error
	GetBlockImages() ([]model.BlockImage, error)
	CreateBlockImage(image model.BlockImage) (string, error)
	DeleteBlockImage(image model.BlockImage) (string, error)
	GetClientAccessInfo() (model.ClientAccessInfo, error)
	GetFilesystems() ([]model.Filesystem, error)
	CreateFilesystem(model.FilesystemRequest) (string, error)
	DeleteFilesystem(model.FilesystemRequest) (string, error)
	GetStatusDetails() (model.StatusDetails, error)
	GetObjectStores() ([]model.ObjectStoreResponse, error)
	CreateObjectStore(store model.ObjectStore) (string, error)
	DeleteObjectStore(storeName string) error
	GetObjectStoreConnectionInfo(storeName string) (*model.ObjectStoreConnectInfo, error)
	ListBuckets(storeName string) ([]model.ObjectBucket, error)
	GetBucket(storeName, bucketName string) (*model.ObjectBucket, error)
	DeleteBucket(storeName, bucketName string, purge bool) error
	ListObjectUsers(storeName string) ([]model.ObjectUser, error)
	GetObjectUser(storeName, id string) (*model.ObjectUser, error)
	CreateObjectUser(storeName string, user model.ObjectUser) (*model.ObjectUser, error)
	UpdateObjectUser(storeName string, user model.ObjectUser) (*model.ObjectUser, error)
	DeleteObjectUser(storeName, id string) error
}

type RookRestError

type RookRestError struct {
	Query  string
	Status int
	Body   []byte
}

func (RookRestError) Error

func (e RookRestError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL