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.
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 ¶
- func AuthDelete(conn Connection, name string) error
- func AuthGetKey(conn Connection, name string) (string, error)
- func AuthGetOrCreateKey(conn Connection, name string, caps []string) (string, error)
- func CreateErasureCodeProfile(conn Connection, config model.ErasureCodedPoolConfig, name string) error
- func CreatePool(conn Connection, newPool CephStoragePoolDetails) (string, error)
- func ExecuteMonCommand(connection Connection, cmd map[string]interface{}, message string) ([]byte, error)
- func ExecuteMonCommandWithInfo(connection Connection, cmd map[string]interface{}, message string) ([]byte, string, error)
- func HealthToModelHealthStatus(cephHealth string) model.HealthStatus
- func ListErasureCodeProfiles(conn Connection) ([]string, error)
- func SetPoolProperty(conn Connection, name, propName string, propVal interface{}) error
- type CephErasureCodeProfile
- type CephStatus
- type CephStoragePoolDetails
- type CephStoragePoolSummary
- type Connection
- type ConnectionFactory
- type HealthService
- type HealthStatus
- type HealthSummary
- type IOContext
- type Image
- type ImageInfo
- type MonMap
- type MonMapEntry
- type MonStatusRequest
- type MonStatusResponse
- type OsdMap
- type PgMap
- type PgStateEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthDelete ¶
func AuthDelete(conn Connection, name string) error
func AuthGetKey ¶
func AuthGetKey(conn Connection, name string) (string, error)
func AuthGetOrCreateKey ¶
func AuthGetOrCreateKey(conn Connection, name string, caps []string) (string, error)
func CreateErasureCodeProfile ¶
func CreateErasureCodeProfile(conn Connection, config model.ErasureCodedPoolConfig, name string) error
func CreatePool ¶
func CreatePool(conn Connection, newPool CephStoragePoolDetails) (string, error)
func ExecuteMonCommand ¶
func ExecuteMonCommand(connection Connection, cmd map[string]interface{}, message string) ([]byte, error)
func HealthToModelHealthStatus ¶
func HealthToModelHealthStatus(cephHealth string) model.HealthStatus
func ListErasureCodeProfiles ¶
func ListErasureCodeProfiles(conn Connection) ([]string, error)
func SetPoolProperty ¶
func SetPoolProperty(conn Connection, name, propName string, propVal interface{}) error
Types ¶
type CephErasureCodeProfile ¶
type CephErasureCodeProfile struct { DataChunkCount uint `json:"k,string"` CodingChunkCount uint `json:"m,string"` Plugin string `json:"plugin"` Technique string `json:"technique"` }
func GetErasureCodeProfileDetails ¶
func GetErasureCodeProfileDetails(conn Connection, name string) (CephErasureCodeProfile, error)
type CephStatus ¶
type CephStatus struct { Health HealthStatus `json:"health"` FSID string `json:"fsid"` ElectionEpoch int `json:"election_epoch"` Quorum []int `json:"quorum"` QuorumNames []string `json:"quorum_names"` MonMap MonMap `json:"monmap"` OsdMap struct { OsdMap OsdMap `json:"osdmap"` } `json:"osdmap"` PgMap PgMap `json:"pgmap"` }
func Status ¶
func Status(conn Connection) (CephStatus, error)
type CephStoragePoolDetails ¶
type CephStoragePoolDetails struct { Name string `json:"pool"` Number int `json:"pool_id"` Size uint `json:"size"` ErasureCodeProfile string `json:"erasure_code_profile"` }
func GetPoolDetails ¶
func GetPoolDetails(conn Connection, name string) (CephStoragePoolDetails, error)
type CephStoragePoolSummary ¶
func ListPoolSummaries ¶
func ListPoolSummaries(conn Connection) ([]CephStoragePoolSummary, error)
type Connection ¶
type Connection interface { Connect() error Shutdown() OpenIOContext(pool string) (IOContext, error) ReadConfigFile(path string) error MonCommand(args []byte) (buffer []byte, info string, err error) MonCommandWithInputBuffer(args, inputBuffer []byte) (buffer []byte, info string, err error) PingMonitor(id string) (string, error) }
interface for connecting to the ceph cluster
type ConnectionFactory ¶
type ConnectionFactory interface { NewConnWithClusterAndUser(clusterName string, userName string) (Connection, error) NewFsid() (string, error) NewSecretKey() (string, error) }
interface for creating connections to ceph
type HealthService ¶
type HealthService struct { Name string `json:"name"` Health string `json:"health"` KbTotal uint64 `json:"kb_total"` KbUsed uint64 `json:"kb_used"` KbAvailable uint64 `json:"kb_avail"` AvailablePercent int `json:"avail_percent"` LastUpdated string `json:"last_updated"` StoreStats struct { BytesTotal uint64 `json:"bytes_total"` BytesSst uint64 `json:"bytes_sst"` BytesLog uint64 `json:"bytes_log"` BytesMisc uint64 `json:"bytes_misc"` LastUpdated string `json:"last_updated"` } `json:"store_stats"` }
func GetMonitorHealthSummaries ¶
func GetMonitorHealthSummaries(cephStatus CephStatus) []HealthService
type HealthStatus ¶
type HealthStatus struct { Details struct { Services []map[string][]HealthService `json:"health_services"` } `json:"health"` Timechecks struct { Epoch int `json:"epoch"` Round int `json:"round"` RoundStatus string `json:"round_status"` } `json:"timechecks"` Summary []HealthSummary `json:"summary"` OverallStatus string `json:"overall_status"` Detail []interface{} `json:"detail"` }
type HealthSummary ¶
type IOContext ¶
type IOContext interface { Read(oid string, data []byte, offset uint64) (int, error) Write(oid string, data []byte, offset uint64) error WriteFull(oid string, data []byte) error Pointer() uintptr GetImage(name string) Image GetImageNames() (names []string, err error) CreateImage(name string, size uint64, order int, args ...uint64) (image Image, err error) }
interface for the ceph io context
type MonMap ¶
type MonMap struct { Epoch int `json:"epoch"` FSID string `json:"fsid"` CreatedTime string `json:"created"` ModifiedTime string `json:"modified"` Mons []MonMapEntry `json:"mons"` }
type MonMapEntry ¶
type MonMapEntry struct { Name string `json:"name"` Rank int `json:"rank"` Address string `json:"addr"` }
represents an entry in the monitor map
type MonStatusRequest ¶
type MonStatusRequest struct { Prefix string `json:"prefix"` Format string `json:"format"` ID int `json:"id"` Weight float32 `json:"weight"` Pool string `json:"pool"` Var string `json:"var"` Args []string `json:"args"` }
request to simplify deserialization of a test request
type MonStatusResponse ¶
type MonStatusResponse struct { Quorum []int `json:"quorum"` MonMap struct { Mons []MonMapEntry `json:"mons"` } `json:"monmap"` }
represents the response from a mon_status mon_command (subset of all available fields, only marshal ones we care about)
func GetMonStatus ¶
func GetMonStatus(adminConn Connection) (MonStatusResponse, error)
calls mon_status mon_command