client

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2016 License: Apache-2.0 Imports: 8 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) CreatePool

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

func (*RookNetworkRestClient) DeleteFilesystem added in v0.1.1

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

func (*RookNetworkRestClient) Do

func (a *RookNetworkRestClient) Do(method, query string, body io.Reader) ([]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) 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.ObjectStoreS3Info, error)

func (*RookNetworkRestClient) GetPools

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

func (*RookNetworkRestClient) GetStatusDetails

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

func (*RookNetworkRestClient) URL

func (a *RookNetworkRestClient) URL() string

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)
	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.ObjectStoreS3Info, 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