Skip to content

Commit 4404f75

Browse files
author
Clark Perkins
committed
Added a couple of blueprint methods and a snapshot mixin
1 parent 8f64bac commit 4404f75

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

stackdio/client/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from .region import RegionMixin
3333
from .settings import SettingsMixin
3434
from .stack import StackMixin
35+
from .snapshot import SnapshotMixin
3536

3637
logger = logging.getLogger(__name__)
3738
logger.addHandler(logging.NullHandler())
@@ -72,7 +73,7 @@ def _get_server_version_info(version_str):
7273

7374

7475
class StackdioClient(BlueprintMixin, FormulaMixin, AccountMixin, ImageMixin,
75-
RegionMixin, StackMixin, SettingsMixin, HttpMixin):
76+
RegionMixin, StackMixin, SettingsMixin, SnapshotMixin, HttpMixin):
7677

7778
def __init__(self, url=None, username=None, password=None, verify=None, cfg_file=None):
7879
self.config = StackdioConfig(cfg_file)

stackdio/client/blueprint.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def search_blueprints(self, **kwargs):
7171
def delete_blueprint(self, blueprint_id):
7272
pass
7373

74+
@get('blueprints/{blueprint_id}/host_definitions/')
75+
def get_blueprint_host_definitions(self, blueprint_id):
76+
pass
77+
78+
@get('blueprints/{blueprint_id}/properties/')
79+
def get_blueprint_properties(self, blueprint_id):
80+
pass
81+
7482
@put('blueprints/{blueprint_id}/properties/')
7583
def update_blueprint_properties(self, blueprint_id, properties):
7684
return properties

stackdio/client/snapshot.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Copyright 2014, Digital Reasoning
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
from .http import HttpMixin, get, post, delete
19+
20+
21+
class SnapshotMixin(HttpMixin):
22+
23+
@post('cloud/snapshots/')
24+
def create_snapshot(self, snapshot):
25+
"""Create a snapshot"""
26+
return snapshot
27+
28+
@get('snapshots/', paginate=True)
29+
def list_snapshots(self):
30+
pass
31+
32+
@get('snapshots/{snapshot_id}/')
33+
def get_snapshot(self, snapshot_id):
34+
pass
35+
36+
@get('snapshots/', paginate=True)
37+
def search_snapshots(self, **kwargs):
38+
pass
39+
40+
@delete('snapshots/{snapshot_id}/')
41+
def delete_snapshot(self, snapshot_id):
42+
pass

0 commit comments

Comments
 (0)