client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 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() (string, error)

func (*RookNetworkRestClient) CreateObjectUser added in v0.3.0

func (c *RookNetworkRestClient) CreateObjectUser(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) DeleteFilesystem added in v0.1.1

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

func (*RookNetworkRestClient) DeleteObjectUser added in v0.3.0

func (c *RookNetworkRestClient) DeleteObjectUser(id 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) 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() (*model.ObjectStoreConnectInfo, error)

func (*RookNetworkRestClient) GetObjectUser added in v0.3.0

func (c *RookNetworkRestClient) GetObjectUser(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() ([]model.ObjectBucket, error)

func (*RookNetworkRestClient) ListObjectUsers added in v0.3.0

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

func (*RookNetworkRestClient) URL

func (a *RookNetworkRestClient) URL() string

func (*RookNetworkRestClient) UpdateObjectUser added in v0.3.0

func (c *RookNetworkRestClient) UpdateObjectUser(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)
	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)
	CreateObjectStore() (string, error)
	GetObjectStoreConnectionInfo() (*model.ObjectStoreConnectInfo, error)
	ListBuckets() ([]model.ObjectBucket, error)
	ListObjectUsers() ([]model.ObjectUser, error)
	GetObjectUser(string) (*model.ObjectUser, error)
	CreateObjectUser(model.ObjectUser) (*model.ObjectUser, error)
	UpdateObjectUser(model.ObjectUser) (*model.ObjectUser, error)
	DeleteObjectUser(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