api

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: 28 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.

Some of the code below came from https://github.com/digitalocean/ceph_exporter which has the same 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 FormatJsonResponse

func FormatJsonResponse(w http.ResponseWriter, object interface{})

Format a json response

func Logger

func Logger(inner http.Handler, name string) http.Handler

func Run added in v0.3.0

func Run(context *clusterd.Context, c *Config) error

func ServeRoutes added in v0.3.0

func ServeRoutes(context *clusterd.Context, c *Config)

func WatchMonConfig added in v0.6.0

func WatchMonConfig(context *clusterd.Context, c *Config)

Types

type CephExporter added in v0.3.1

type CephExporter struct {
	// contains filtered or unexported fields
}

CephExporter wraps all the ceph collectors and provides a single global exporter to extracts metrics out of. It also ensures that the collection is done in a thread-safe manner, the necessary requirement stated by prometheus. It also implements a prometheus.Collector interface in order to register it correctly.

func NewCephExporter added in v0.3.1

func NewCephExporter(h *Handler) *CephExporter

NewCephExporter creates an instance to CephExporter and returns a reference to it. We can choose to enable a collector to extract stats out of by adding it to the list of collectors.

func (*CephExporter) Collect added in v0.3.1

func (c *CephExporter) Collect(ch chan<- prometheus.Metric)

Collect sends the collected metrics from each of the collectors to prometheus. Collect could be called several times concurrently and thus its run is protected by a single mutex.

func (*CephExporter) Describe added in v0.3.1

func (c *CephExporter) Describe(ch chan<- *prometheus.Desc)

Describe sends all the descriptors of the collectors included to the provided channel.

type Config added in v0.3.0

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig added in v0.6.0

func NewConfig(context *clusterd.Context, port int, clusterInfo *mon.ClusterInfo, namespace, versionTag string, hostNetwork bool) *Config

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) CreateFileSystem added in v0.1.1

func (h *Handler) CreateFileSystem(w http.ResponseWriter, r *http.Request)

Creates a new file system in this cluster. POST /filesystem

func (*Handler) CreateImage

func (h *Handler) CreateImage(w http.ResponseWriter, r *http.Request)

Creates a new image in this cluster. POST /image

func (*Handler) CreateObjectStore added in v0.1.1

func (h *Handler) CreateObjectStore(w http.ResponseWriter, r *http.Request)

CreateObjectStore creates a new object store in this cluster. POST /objectstore

func (*Handler) CreatePool

func (h *Handler) CreatePool(w http.ResponseWriter, r *http.Request)

Creates a storage pool as specified by the request body. POST /pool

func (*Handler) CreateUser added in v0.3.0

func (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser will create a new user from the passed info in the object store in this cluster. POST /objectstore/{name}/users

func (*Handler) DeleteBucket added in v0.5.0

func (h *Handler) DeleteBucket(w http.ResponseWriter, r *http.Request)

DeleteBucket deletes the bucket in the object store in this cluster. DELETE /objectstore/{name}/buckets/{BUCKET_NAME}

func (*Handler) DeleteImage added in v0.3.1

func (h *Handler) DeleteImage(w http.ResponseWriter, r *http.Request)

Deletes a block image from this cluster. DELETE /image?name=<imageName>&pool=<imagePool>

func (*Handler) DeletePool added in v0.6.0

func (h *Handler) DeletePool(w http.ResponseWriter, r *http.Request)

Creates a storage pool as specified by the request body. DELETE /pool/{name}

func (*Handler) DeleteUser added in v0.3.0

func (h *Handler) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser deletes the passed user for the object store in this cluster. DELETE /objectstore/{name}/users/{USER_ID}

func (*Handler) GetBucket added in v0.5.0

func (h *Handler) GetBucket(w http.ResponseWriter, r *http.Request)

GetBucket gets the bucket from the object store in this cluster. GET /objectstore/{name}/buckets/{BUCKET_NAME}

func (*Handler) GetClientAccessInfo added in v0.1.1

func (h *Handler) GetClientAccessInfo(w http.ResponseWriter, r *http.Request)

Gets the information needed for a client to access the cluster. GET /client

func (*Handler) GetFileSystems added in v0.1.1

func (h *Handler) GetFileSystems(w http.ResponseWriter, r *http.Request)

Gets a listing of file systems in this cluster. GET /filesystem

func (*Handler) GetImages

func (h *Handler) GetImages(w http.ResponseWriter, r *http.Request)

Gets the images that have been created in this cluster. GET /image

func (*Handler) GetNodes

func (h *Handler) GetNodes(w http.ResponseWriter, r *http.Request)

Gets the nodes that are part of this cluster. GET /node

func (*Handler) GetObjectStoreConnectionInfo added in v0.2.0

func (h *Handler) GetObjectStoreConnectionInfo(w http.ResponseWriter, r *http.Request)

GetObjectStoreConnectionInfo gets connection information to the object store in this cluster. GET /objectstore/{name}/connectioninfo

func (*Handler) GetObjectStores added in v0.6.0

func (h *Handler) GetObjectStores(w http.ResponseWriter, r *http.Request)

GetObjectStores gets the object stores in this cluster. GET /objectstore

func (*Handler) GetPools

func (h *Handler) GetPools(w http.ResponseWriter, r *http.Request)

Gets the storage pools that have been created in this cluster. GET /pool

func (*Handler) GetRoutes

func (h *Handler) GetRoutes() []Route

func (*Handler) GetStatusDetails

func (h *Handler) GetStatusDetails(w http.ResponseWriter, r *http.Request)

Gets the status details of this cluster. GET /status

func (*Handler) GetUser added in v0.3.0

func (h *Handler) GetUser(w http.ResponseWriter, r *http.Request)

GetUser gets the passed users info from the object store in this cluster. GET /objectstore/{name}/users/{id}

func (*Handler) ListBuckets added in v0.5.0

func (h *Handler) ListBuckets(w http.ResponseWriter, r *http.Request)

Listbuckets lists the buckets in the object store in this cluster. GET /objectstore/{name}/buckets

func (*Handler) ListUsers added in v0.3.0

func (h *Handler) ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers lists the users of the object store in this cluster. GET /objectstore/{name}/users

func (*Handler) RegisterMetrics added in v0.3.1

func (h *Handler) RegisterMetrics(retryMs int) error

RegisterMetrics registers all collected metrics by this API server. Note this should be called in a goroutine because it will retry upon failure and block until successful.

func (*Handler) RemoveFileSystem added in v0.1.1

func (h *Handler) RemoveFileSystem(w http.ResponseWriter, r *http.Request)

Removes an existing filesystem from this cluster. DELETE /filesystem?name=<fsName>

func (*Handler) RemoveObjectStore added in v0.1.1

func (h *Handler) RemoveObjectStore(w http.ResponseWriter, r *http.Request)

RemoveObjectStore removes the object store from this cluster. DELETE /objectstore/{name}

func (*Handler) SetLogLevel added in v0.1.1

func (h *Handler) SetLogLevel(w http.ResponseWriter, r *http.Request)

Sets the log level for this node. POST /log

func (*Handler) Shutdown added in v0.3.1

func (h *Handler) Shutdown()

func (*Handler) UpdateUser added in v0.3.0

func (h *Handler) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser updates the passed user with the passed info for the object store in this cluster. PUT /objectstore/{name}/users/{USER_ID}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Jump to

Keyboard shortcuts

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