Documentation ¶
Overview ¶
Package storagepolicy manages storage policy and apply/validate storage policy restriction volume operations. Copyright 2018 Portworx
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 ¶
- Variables
- type PolicyManager
- type SdkPolicyManager
- func (p *SdkPolicyManager) Create(ctx context.Context, req *api.SdkOpenStoragePolicyCreateRequest) (*api.SdkOpenStoragePolicyCreateResponse, error)
- func (p *SdkPolicyManager) DefaultInspect(ctx context.Context, req *api.SdkOpenStoragePolicyDefaultInspectRequest) (*api.SdkOpenStoragePolicyDefaultInspectResponse, error)
- func (p *SdkPolicyManager) Delete(ctx context.Context, req *api.SdkOpenStoragePolicyDeleteRequest) (*api.SdkOpenStoragePolicyDeleteResponse, error)
- func (p *SdkPolicyManager) Enumerate(ctx context.Context, req *api.SdkOpenStoragePolicyEnumerateRequest) (*api.SdkOpenStoragePolicyEnumerateResponse, error)
- func (p *SdkPolicyManager) Inspect(ctx context.Context, req *api.SdkOpenStoragePolicyInspectRequest) (*api.SdkOpenStoragePolicyInspectResponse, error)
- func (p *SdkPolicyManager) Release(ctx context.Context, req *api.SdkOpenStoragePolicyReleaseRequest) (*api.SdkOpenStoragePolicyReleaseResponse, error)
- func (p *SdkPolicyManager) SetDefault(ctx context.Context, req *api.SdkOpenStoragePolicySetDefaultRequest) (*api.SdkOpenStoragePolicySetDefaultResponse, error)
- func (p *SdkPolicyManager) Update(ctx context.Context, req *api.SdkOpenStoragePolicyUpdateRequest) (*api.SdkOpenStoragePolicyUpdateResponse, error)
Constants ¶
This section is empty.
Variables ¶
var (
Inst = func() (PolicyManager, error) {
return policyInst()
}
)
Functions ¶
This section is empty.
Types ¶
type PolicyManager ¶
type PolicyManager interface { api.OpenStoragePolicyServer }
PolicyManager provides an implementation if OpenStoragePolicy service methods.
func Init ¶
func Init() (PolicyManager, error)
type SdkPolicyManager ¶
type SdkPolicyManager struct { }
SdkPolicyManager is an implementation of the Storage Policy Manager for the SDK
func (*SdkPolicyManager) Create ¶
func (p *SdkPolicyManager) Create( ctx context.Context, req *api.SdkOpenStoragePolicyCreateRequest, ) (*api.SdkOpenStoragePolicyCreateResponse, error)
Create Storage policy
func (*SdkPolicyManager) DefaultInspect ¶
func (p *SdkPolicyManager) DefaultInspect( ctx context.Context, req *api.SdkOpenStoragePolicyDefaultInspectRequest, ) (*api.SdkOpenStoragePolicyDefaultInspectResponse, error)
DefaultInspect return default storeage policy details
func (*SdkPolicyManager) Delete ¶
func (p *SdkPolicyManager) Delete( ctx context.Context, req *api.SdkOpenStoragePolicyDeleteRequest, ) (*api.SdkOpenStoragePolicyDeleteResponse, error)
Delete storage policy specified by name
func (*SdkPolicyManager) Enumerate ¶
func (p *SdkPolicyManager) Enumerate( ctx context.Context, req *api.SdkOpenStoragePolicyEnumerateRequest, ) (*api.SdkOpenStoragePolicyEnumerateResponse, error)
Enumerate all of storage policies
func (*SdkPolicyManager) Inspect ¶
func (p *SdkPolicyManager) Inspect( ctx context.Context, req *api.SdkOpenStoragePolicyInspectRequest, ) (*api.SdkOpenStoragePolicyInspectResponse, error)
Inspect storage policy specifed by name
func (*SdkPolicyManager) Release ¶
func (p *SdkPolicyManager) Release( ctx context.Context, req *api.SdkOpenStoragePolicyReleaseRequest, ) (*api.SdkOpenStoragePolicyReleaseResponse, error)
Release storage policy if set as default
func (*SdkPolicyManager) SetDefault ¶
func (p *SdkPolicyManager) SetDefault( ctx context.Context, req *api.SdkOpenStoragePolicySetDefaultRequest, ) (*api.SdkOpenStoragePolicySetDefaultResponse, error)
SetDefault storage policy
func (*SdkPolicyManager) Update ¶
func (p *SdkPolicyManager) Update( ctx context.Context, req *api.SdkOpenStoragePolicyUpdateRequest, ) (*api.SdkOpenStoragePolicyUpdateResponse, error)
Update Storage policy TODO: Decide whether update storage policy request should update ownership at all We can check if user is admin then only allow update ownership