Compare commits

..

20 Commits

Author SHA1 Message Date
Jenkins
faf5c656af Merge "Add metadata parameter to checkpoint API" 2016-11-23 02:48:00 +00:00
chenying
fc425e741d Add a filter argument operation_definition for scheduledoperations API
Change-Id: I16c79491c51c341d692066c78611b218d0731435
2016-11-14 19:22:51 +08:00
Jenkins
74a382ecb6 Merge "Updated from global requirements" 2016-11-09 12:05:16 +00:00
Jenkins
59ef5ebda0 Merge "Make method import_versioned_module work" 2016-11-09 08:49:15 +00:00
OpenStack Proposal Bot
e273aa5b55 Updated from global requirements
Change-Id: Ie04ae794555e6266141ff4cdcca0121028685e0e
2016-11-09 04:23:47 +00:00
pawnesh.kumar
fae4ef7a03 Make method import_versioned_module work
Update function import_versioned_module in Oslo.utils 3.17.
This patch update to meet new version. For more information:
http://docs.openstack.org/developer/oslo.utils/history.html

Change-Id: I8b856c4a6a017fdc668326cb18c0b14d6d09ddc2
Closes-Bug: #1627313
2016-11-02 16:51:11 +05:30
Tony Xu
f3ca2e6944 Add Python 3.5 classifier and venv
Now that there is a passing gate job, we can claim
support for Python 3.5 in the classifier.
This patch also adds the convenience py35 venv.

Change-Id: I17e31b7c5218be7ad0b9d3cde9536522d77af24f
2016-10-26 00:09:04 +08:00
Jenkins
ac61ea3499 Merge "Add parameters field for protectable instances API" 2016-10-20 02:31:00 +00:00
Jenkins
e689b3233e Merge "Add a description field for resource plan" 2016-10-06 13:07:28 +00:00
Jenkins
1f422f4c5c Merge "Add trigger update client" 2016-10-06 13:07:19 +00:00
Jenkins
fda6cdfb7b Merge "Remove copy of incubated Oslo code" 2016-10-06 12:57:15 +00:00
OpenStack Proposal Bot
448bb4468f Updated from global requirements
Change-Id: Ic3a9ecca756ec01c986f0028b5bf49dfbb11ca48
2016-09-30 20:05:43 +00:00
ChangBo Guo(gcb)
ce263ecc9e Remove copy of incubated Oslo code
The Oslo team has moved all previously incubated code from the
openstack/oslo-incubator repository into separate library repositories
and released those libraries to the Python Package Index. Many of our
big tent project teams are still using the old, unsupported, incubated
versions of the code. The Oslo team has been working to remove that
incubated code from projects, and the time has come to finish that work.

As one of community-wide goals in Ocata, please see:
https://github.com/openstack/governance/blob/master/goals/ocata/remove-incubated-oslo-code.rst

Note: This commit also fix pep8 violations.

Change-Id: Ic2d8079b85ebd302a27785772462378f13d593d0
2016-09-29 15:33:58 +00:00
Jenkins
d2d3a475e2 Merge "Update homepage with developer documentation page" 2016-09-29 11:05:51 +00:00
yizhihui
e0a2b0edcd Fix restore-create failed with "no attribute 'username'"
Change-Id: I5fa824a82d199fef6620318ccb93f156c69652bd
2016-09-29 12:29:05 +08:00
chenying
49aae96f22 Add parameters field for protectable instances API
Scenario #1
User need a parameter for the region name to query resource
instances from different region endpoint.

Scenario #2
User uses the Protectable Instances API to query database
instances from the verdor's backup software. User must provide
some parameters about authentication to the restfull API of the
verdor's backup software.

A dict type parameter is needed for Protectable Instances API.
And it is optional.

blueprint instances-parameters

Change-Id: I9b5d2dc581edda23543f4b264c334bc429bcd3c3
2016-09-27 15:50:18 +08:00
Tony Xu
6113f97d2f Update homepage with developer documentation page
Change-Id: I4d833e796da4ee02485e197c7ec5603f229e188f
2016-09-27 00:37:45 +08:00
chenying
f18cf64f9d Add a description field for resource plan
Change-Id: I2191a557b2777a9c7e92b1c9bc0fb153cb7ec2af
2016-09-22 20:19:46 +08:00
zhangshuai
4c6a252b76 Add trigger update client
To keep consistency with api doc, add trigger update client,
and fix plan update client.

Change-Id: Ie2e6e01bde0d3c8a947685874dcb2d82a6a49e12
2016-09-21 11:21:00 +08:00
chenying
7e81c138ec Add metadata parameter to checkpoint API
Change-Id: I86f6e6e8338e8256fec62a61275aeff8669b830c
2016-09-01 14:55:38 +08:00
28 changed files with 198 additions and 110 deletions

View File

@@ -9,10 +9,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from karborclient.common import utils
from oslo_utils import importutils
def Client(version, *args, **kwargs):
module = utils.import_versioned_module(version, 'client')
module = importutils.import_versioned_module(
'karborclient', version, 'client'
)
client_class = getattr(module, 'Client')
return client_class(*args, **kwargs)

View File

@@ -24,7 +24,7 @@ import os
import six
from stevedore import extension
from karborclient.openstack.common.apiclient import exceptions
from karborclient.common.apiclient import exceptions
_discovered_plugins = {}
@@ -41,7 +41,7 @@ def discover_auth_systems():
def add_plugin(ext):
_discovered_plugins[ext.name] = ext.plugin
ep_namespace = "karborclient.openstack.common.apiclient.auth"
ep_namespace = "karborclient.common.apiclient.auth"
mgr = extension.ExtensionManager(ep_namespace)
mgr.map(add_plugin)
@@ -143,8 +143,7 @@ class BaseAuthPlugin(object):
@classmethod
def add_opts(cls, parser):
"""Populate the parser with the options for this plugin.
"""
"""Populate the parser with the options for this plugin."""
for opt in cls.opt_names:
# use `BaseAuthPlugin.common_opt_names` since it is never
# changed in child classes
@@ -153,8 +152,7 @@ class BaseAuthPlugin(object):
@classmethod
def add_common_opts(cls, parser):
"""Add options that are common for several plugins.
"""
"""Add options that are common for several plugins."""
for opt in cls.common_opt_names:
cls._parser_add_opt(parser, opt)
@@ -191,8 +189,7 @@ class BaseAuthPlugin(object):
@abc.abstractmethod
def _do_authenticate(self, http_client):
"""Protected method for authentication.
"""
"""Protected method for authentication."""
def sufficient_options(self):
"""Check if all required options are present.

View File

@@ -31,8 +31,8 @@ from oslo_utils import uuidutils
import six
from six.moves.urllib import parse
from karborclient.common.apiclient import exceptions
from karborclient.i18n import _
from karborclient.openstack.common.apiclient import exceptions
def getid(obj):
@@ -462,8 +462,7 @@ class Resource(object):
@property
def human_id(self):
"""Human-readable ID which can be used for bash completion.
"""
"""Human-readable ID which can be used for bash completion."""
if self.HUMAN_ID:
name = getattr(self, self.NAME_ATTR, None)
if name is not None:
@@ -481,7 +480,7 @@ class Resource(object):
def __getattr__(self, k):
if k not in self.__dict__:
#NOTE(bcwaldon): disallow lazy-loading if already loaded once
# NOTE(bcwaldon): disallow lazy-loading if already loaded once
if not self.is_loaded():
self.get()
return self.__getattr__(k)

View File

@@ -40,7 +40,6 @@ from karborclient.i18n import _
from karborclient.openstack.common.apiclient import exceptions
_logger = logging.getLogger(__name__)
@@ -63,7 +62,7 @@ class HTTPClient(object):
into terminal and send the same request with curl.
"""
user_agent = "karborclient.openstack.common.apiclient"
user_agent = "karborclient.common.apiclient"
def __init__(self,
auth_plugin,
@@ -272,7 +271,7 @@ class HTTPClient(object):
>>> def test_clients():
... from keystoneclient.auth import keystone
... from openstack.common.apiclient import client
... from karborclient.common.apiclient import client
... auth = keystone.KeystoneAuthPlugin(
... username="user", password="pass", tenant_name="tenant",
... auth_url="http://auth:5000/v2.0")
@@ -358,8 +357,7 @@ class BaseClient(object):
"Must be one of: %(version_map)s") % {
'api_name': api_name,
'version': version,
'version_map': ', '.join(version_map.keys())
}
'version_map': ', '.join(version_map.keys())}
raise exceptions.UnsupportedVersion(msg)
return importutils.import_class(client_path)

View File

@@ -28,8 +28,7 @@ from karborclient.i18n import _
class ClientException(Exception):
"""The base exception class for all exceptions this library raises.
"""
"""The base exception class for all exceptions this library raises."""
pass
@@ -107,8 +106,7 @@ class AmbiguousEndpoints(EndpointException):
class HttpError(ClientException):
"""The base exception class for all HTTP exceptions.
"""
"""The base exception class for all HTTP exceptions."""
http_status = 0
message = _("HTTP Error")
@@ -426,7 +424,7 @@ def from_response(response, method, url):
"""
req_id = response.headers.get("x-openstack-request-id")
#NOTE(hdd) true for older versions of nova and cinder
# NOTE(hdd) true for older versions of nova and cinder
if not req_id:
req_id = response.headers.get("x-compute-request-id")
kwargs = {

View File

@@ -30,7 +30,7 @@ import requests
import six
from six.moves.urllib import parse
from karborclient.openstack.common.apiclient import client
from karborclient.common.apiclient import client
def assert_has_keys(dct, required=None, optional=None):
@@ -48,8 +48,7 @@ def assert_has_keys(dct, required=None, optional=None):
class TestResponse(requests.Response):
"""Wrap requests.Response and provide a convenient initialization.
"""
"""Wrap requests.Response and provide a convenient initialization."""
def __init__(self, data):
super(TestResponse, self).__init__()
@@ -86,13 +85,12 @@ class FakeHTTPClient(client.HTTPClient):
def __init__(self, *args, **kwargs):
self.callstack = []
self.fixtures = kwargs.pop("fixtures", None) or {}
if not args and not "auth_plugin" in kwargs:
if not args and "auth_plugin" not in kwargs:
args = (None, )
super(FakeHTTPClient, self).__init__(*args, **kwargs)
def assert_called(self, method, url, body=None, pos=-1):
"""Assert than an API method was just called.
"""
"""Assert than an API method was just called."""
expected = (method, url)
called = self.callstack[pos][0:2]
assert self.callstack, \
@@ -107,8 +105,7 @@ class FakeHTTPClient(client.HTTPClient):
(self.callstack[pos][3], body))
def assert_called_anytime(self, method, url, body=None):
"""Assert than an API method was called anytime in the test.
"""
"""Assert than an API method was called anytime in the test."""
expected = (method, url)
assert self.callstack, \

View File

@@ -20,8 +20,9 @@ import copy
import six
from six.moves.urllib import parse
from karborclient.common.apiclient import exceptions
from karborclient.common import http
from karborclient.openstack.common.apiclient import exceptions
SORT_DIR_VALUES = ('asc', 'desc')
SORT_KEY_VALUES = ('id', 'status', 'name', 'created_at')

View File

@@ -26,7 +26,7 @@ import requests
import six
from six.moves import urllib
from karborclient.openstack.common.apiclient import exceptions as exc
from karborclient.common.apiclient import exceptions as exc
LOG = logging.getLogger(__name__)
USER_AGENT = 'python-karborclient'

View File

@@ -19,11 +19,10 @@ import six
import uuid
from oslo_utils import encodeutils
from oslo_utils import importutils
import prettytable
from karborclient.openstack.common.apiclient import exceptions
from karborclient.common.apiclient import exceptions
# Decorator for cli-args
@@ -49,13 +48,6 @@ def env(*vars, **kwargs):
return kwargs.get('default', '')
def import_versioned_module(version, submodule=None):
module = 'karborclient.v%s' % version
if submodule:
module = '.'.join((module, submodule))
return importutils.import_module(module)
def _print(pt, order):
if sys.version_info >= (3, 0):
print(pt.get_string(sortby=order))

View File

@@ -1,17 +0,0 @@
#
# 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.
import six
six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox'))

View File

@@ -28,13 +28,16 @@ from keystoneclient import session as ksession
from oslo_log import handlers
from oslo_log import log as logging
from oslo_utils import encodeutils
from oslo_utils import importutils
import six
import six.moves.urllib.parse as urlparse
import karborclient
from karborclient import client as karbor_client
from karborclient.common.apiclient import exceptions as exc
from karborclient.common import utils
from karborclient.openstack.common.apiclient import exceptions as exc
logger = logging.getLogger(__name__)
@@ -149,7 +152,9 @@ class KarborShell(object):
self.subcommands = {}
subparsers = parser.add_subparsers(metavar='<subcommand>')
submodule = utils.import_versioned_module(version, 'shell')
submodule = importutils.import_versioned_module(
'karborclient', version, 'shell'
)
self._find_actions(subparsers, submodule)
self._find_actions(subparsers, self)

View File

@@ -16,8 +16,8 @@ import socket
import mock
import testtools
from karborclient.common.apiclient import exceptions as exc
from karborclient.common import http
from karborclient.openstack.common.apiclient import exceptions as exc
from karborclient.tests.unit import fakes

View File

@@ -23,7 +23,7 @@ from oslo_log import log
import six
from testtools import matchers
from karborclient.openstack.common.apiclient import exceptions
from karborclient.common.apiclient import exceptions
import karborclient.shell
from karborclient.tests.unit import base

View File

@@ -88,5 +88,5 @@ class CheckpointsTest(base.TestCaseShell):
'checkpoints'.format(
provider_id=FAKE_PROVIDER_ID),
data={
'checkpoint': {'plan_id': FAKE_PLAN_ID}},
'checkpoint': {'plan_id': FAKE_PLAN_ID, 'extra-info': None}},
headers={})

View File

@@ -48,7 +48,7 @@ class PlansTest(base.TestCaseShell):
@mock.patch('karborclient.common.http.HTTPClient.json_request')
def test_create_plan(self, mock_request):
mock_request.return_value = mock_request_return
cs.plans.create('Plan name', 'provider_id', '', "")
cs.plans.create('Plan name', 'provider_id', '', "", '')
mock_request.assert_called_with(
'POST',
'/plans',
@@ -56,7 +56,8 @@ class PlansTest(base.TestCaseShell):
'plan': {'provider_id': 'provider_id',
'name': 'Plan name',
'resources': '',
'parameters': ''}},
'parameters': '',
'description': ''}},
headers={})
@mock.patch('karborclient.common.http.HTTPClient.raw_request')

View File

@@ -66,7 +66,7 @@ class TriggersTest(base.TestCaseShell):
headers={})
@mock.patch('karborclient.common.http.HTTPClient.json_request')
def test_show_plan(self, mock_request):
def test_show_trigger(self, mock_request):
mock_request.return_value = mock_request_return
cs.triggers.get('1')
mock_request.assert_called_with(
@@ -82,3 +82,18 @@ class TriggersTest(base.TestCaseShell):
'GET',
'/triggers/1',
headers={'X-Configuration-Session': 'fake_session_id'})
@mock.patch('karborclient.common.http.HTTPClient.json_request')
def test_update_trigger(self, mock_request):
mock_request.return_value = mock_request_return
trigger_id = '123'
data = {"name": "My Trigger",
"properties": {"pattern": "0 10 * * *", "format": "crontab"}}
body = {"trigger_info": data}
cs.triggers.update(trigger_id, data)
mock_request.assert_called_with(
'PUT',
'/triggers/123',
data=body,
headers={}
)

View File

@@ -26,8 +26,9 @@ class Checkpoint(base.Resource):
class CheckpointManager(base.ManagerWithFind):
resource_class = Checkpoint
def create(self, provider_id, plan_id):
body = {'checkpoint': {'plan_id': plan_id}}
def create(self, provider_id, plan_id, checkpoint_extra_info=None):
body = {'checkpoint': {'plan_id': plan_id,
'extra-info': checkpoint_extra_info}}
url = "/providers/{provider_id}/" \
"checkpoints" .format(provider_id=provider_id)
return self._create(url, body, 'checkpoint')

View File

@@ -24,8 +24,10 @@ class Plan(base.Resource):
class PlanManager(base.ManagerWithFind):
resource_class = Plan
def create(self, name, provider_id, resources, parameters):
def create(self, name, provider_id, resources, parameters,
description=None):
body = {'plan': {'name': name,
'description': description,
'provider_id': provider_id,
'resources': resources,
'parameters': parameters

View File

@@ -77,14 +77,27 @@ class ProtectableManager(base.ManagerWithFind):
sort_dir=sort_dir, sort=sort)
return self._list(url, response_key='instances', obj_class=Instances)
def get_instance(self, type, id, session_id=None):
def get_instance(self, type, id, search_opts=None, session_id=None):
if session_id:
headers = {'X-Configuration-Session': session_id}
else:
headers = {}
url = "/protectables/{protectable_type}/" \
"instances/{protectable_id}".format(protectable_type=type,
protectable_id=id)
if search_opts is None:
search_opts = {}
query_params = {}
for key, val in search_opts.items():
if val:
query_params[key] = val
query_string = ""
if query_params:
params = sorted(query_params.items(), key=lambda x: x[0])
query_string = "?%s" % parse.urlencode(params)
url = ("/protectables/{protectable_type}/instances/"
"{protectable_id}{query_string}").format(
protectable_type=type, protectable_id=id,
query_string=query_string)
return self._get(url, response_key="instance", headers=headers)
def _build_instances_list_url(self, protectable_type,

View File

@@ -11,15 +11,15 @@
# under the License.
import argparse
import os
from karborclient.common import base
from karborclient.common import utils
from karborclient.openstack.common.apiclient import exceptions
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from karborclient.common.apiclient import exceptions
from karborclient.common import base
from karborclient.common import utils
@utils.arg('--all-tenants',
dest='all_tenants',
@@ -94,7 +94,7 @@ def do_plan_list(cs, args):
limit=args.limit, sort_key=args.sort_key,
sort_dir=args.sort_dir, sort=args.sort)
key_list = ['Id', 'Name', 'Provider id', 'Status']
key_list = ['Id', 'Name', 'Description', 'Provider id', 'Status']
if args.sort_key or args.sort_dir or args.sort:
sortby_index = None
@@ -129,12 +129,15 @@ def do_plan_list(cs, args):
'resource_id: limit the parameters to a specific resource. '
'Other keys and values: according to provider\'s protect schema.'
)
@utils.arg('--description',
metavar='<description>',
help='The description of a plan.')
def do_plan_create(cs, args):
"""Create a plan."""
plan_resources = _extract_resources(args)
plan_parameters = _extract_parameters(args)
plan = cs.plans.create(args.name, args.provider_id, plan_resources,
plan_parameters)
plan_parameters, description=args.description)
utils.print_dict(plan.to_dict())
@@ -171,7 +174,7 @@ def do_plan_delete(cs, args):
help="Id of plan to update.")
@utils.arg("--name", metavar="<name>",
help="A name to which the plan will be renamed.")
@utils.arg("--resources", metavar="<id=type,id=type>",
@utils.arg("--resources", metavar="<id=type=name,id=type=name>",
help="Resources to which the plan will be updated.")
@utils.arg("--status", metavar="<suspended|started>",
help="status to which the plan will be updated.")
@@ -222,11 +225,11 @@ def _extract_resources(args):
metavar='<restore_target>',
help='Restore target.')
@utils.arg('restore_username',
metavar='<username>',
metavar='<restore_username>',
default="",
help='Username to restore target.')
@utils.arg('restore_password',
metavar='<password>',
metavar='<restore_password>',
default="",
help='Password to restore target.')
@utils.arg('--parameters-json',
@@ -257,8 +260,8 @@ def do_restore_create(cs, args):
restore_parameters = _extract_parameters(args)
restore_auth = {
'type': 'password',
'username': args.username,
'password': args.password,
'username': args.restore_username,
'password': args.restore_password,
}
restore = cs.restores.create(args.provider_id, args.checkpoint_id,
args.restore_target, restore_parameters,
@@ -414,16 +417,28 @@ def do_protectable_show(cs, args):
utils.print_dict(protectable.to_dict())
@utils.arg('protectable_id',
metavar='<protectable_id>',
help='Protectable instance id.')
@utils.arg('protectable_type',
metavar='<protectable_type>',
help='Protectable type.')
@utils.arg('protectable_id',
metavar='<protectable_id>',
help='Protectable instance id.')
@utils.arg('--parameters',
type=str,
nargs='*',
metavar='<key=value>',
default=None,
help='Show a instance by parameters key and value pair. '
'Default=None.')
def do_protectable_show_instance(cs, args):
"""Shows instance details."""
search_opts = {
'parameters': (_extract_instances_parameters(args)
if args.parameters else None),
}
instance = cs.protectables.get_instance(args.protectable_type,
args.protectable_id)
args.protectable_id,
search_opts=search_opts)
utils.print_dict(instance.to_dict())
@@ -459,11 +474,20 @@ def do_protectable_show_instance(cs, args):
'form of <key>[:<asc|desc>]. '
'Valid keys: %s. '
'Default=None.') % ', '.join(base.SORT_KEY_VALUES)))
@utils.arg('--parameters',
type=str,
nargs='*',
metavar='<key=value>',
default=None,
help='List instances by parameters key and value pair. '
'Default=None.')
def do_protectable_list_instances(cs, args):
"""Lists all protectable instances."""
search_opts = {
'type': args.type,
'parameters': (_extract_instances_parameters(args)
if args.parameters else None),
}
if args.sort and (args.sort_key or args.sort_dir):
@@ -487,6 +511,19 @@ def do_protectable_list_instances(cs, args):
sortby_index=sortby_index)
def _extract_instances_parameters(args):
parameters = {}
for parameter in args.parameters:
if '=' in parameter:
(key, value) = parameter.split('=', 1)
else:
key = parameter
value = None
parameters[key] = value
return parameters
@utils.arg('provider_id',
metavar='<provider_id>',
help='Id of provider.')
@@ -562,12 +599,37 @@ def do_provider_list(cs, args):
@utils.arg('plan_id',
metavar='<plan_id>',
help='ID of plan.')
@utils.arg('--extra_info',
type=str,
nargs='*',
metavar='<key=value>',
default=None,
help='The extra info of a checkpoint.')
def do_checkpoint_create(cs, args):
"""Create a checkpoint."""
checkpoint = cs.checkpoints.create(args.provider_id, args.plan_id)
checkpoint_extra_info = None
if args.extra_info is not None:
checkpoint_extra_info = _extract_extra_info(args)
checkpoint = cs.checkpoints.create(args.provider_id, args.plan_id,
checkpoint_extra_info)
utils.print_dict(checkpoint.to_dict())
def _extract_extra_info(args):
checkpoint_extra_info = {}
for data in args.extra_info:
# unset doesn't require a val, so we have the if/else
if '=' in data:
(key, value) = data.split('=', 1)
else:
key = data
value = None
checkpoint_extra_info[key] = value
return checkpoint_extra_info
@utils.arg('provider_id',
metavar='<provider_id>',
help='ID of provider.')
@@ -622,7 +684,7 @@ def do_checkpoint_list(cs, args):
marker=args.marker, limit=args.limit, sort_key=args.sort_key,
sort_dir=args.sort_dir, sort=args.sort)
key_list = ['Id', 'Project id', 'Status', 'Protection plan']
key_list = ['Id', 'Project id', 'Status', 'Protection plan', 'Metadata']
if args.sort_key or args.sort_dir or args.sort:
sortby_index = None
@@ -785,6 +847,22 @@ def _extract_properties(args):
return properties
@utils.arg("trigger_id", metavar="<TRIGGER ID>",
help="Id of trigger to update.")
@utils.arg("--name", metavar="<name>",
help="A new name to which the trigger will be renamed.")
@utils.arg("--properties", metavar="<key=value:key=value>",
help="Properties of trigger which will be updated.")
def do_trigger_update(cs, args):
"""Update a trigger."""
trigger_info = {}
trigger_properties = _extract_properties(args)
trigger_info['name'] = args.name
trigger_info['properties'] = trigger_properties
trigger = cs.triggers.update(args.trigger_id, trigger_info)
utils.print_dict(trigger.to_dict())
@utils.arg('trigger',
metavar='<trigger>',
help='ID of trigger.')
@@ -839,6 +917,10 @@ def do_trigger_delete(cs, args):
metavar='<trigger_id>',
default=None,
help='Filters results by a trigger id. Default=None.')
@utils.arg('--operation_definition',
metavar='<operation_definition>',
default=None,
help='Filters results by the operation_definition. Default=None.')
@utils.arg('--marker',
metavar='<marker>',
default=None,
@@ -881,6 +963,7 @@ def do_scheduledoperation_list(cs, args):
'name': args.name,
'operation_type': args.operation_type,
'trigger_id': args.trigger_id,
'operation_definition': args.operation_definition,
}
if args.sort and (args.sort_key or args.sort_dir):

View File

@@ -46,6 +46,14 @@ class TriggerManager(base.ManagerWithFind):
trigger_id=trigger_id)
return self._get(url, response_key="trigger_info", headers=headers)
def update(self, trigger_id, data):
body = {"trigger_info": data}
return self._update('/triggers/{trigger_id}'
.format(trigger_id=trigger_id),
body, "trigger_info")
def list(self, detailed=False, search_opts=None, marker=None, limit=None,
sort_key=None, sort_dir=None, sort=None):
"""Lists all triggers."""

View File

@@ -1,8 +0,0 @@
[DEFAULT]
# The list of modules to copy from openstack-common
module=apiclient.exceptions
module=apiclient
# The base module to hold the copy of openstack.common
base=karborclient

View File

@@ -1,13 +1,13 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr>=1.6 # Apache-2.0
PrettyTable<0.8,>=0.7 # BSD
python-keystoneclient!=2.1.0,>=2.0.0 # Apache-2.0
pbr>=1.8 # Apache-2.0
PrettyTable<0.8,>=0.7.1 # BSD
python-keystoneclient>=3.6.0 # Apache-2.0
requests>=2.10.0 # Apache-2.0
simplejson>=2.2.0 # MIT
Babel>=2.3.4 # BSD
six>=1.9.0 # MIT
oslo.utils>=3.16.0 # Apache-2.0
oslo.utils>=3.18.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0

View File

@@ -5,7 +5,7 @@ description-file =
README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = http://www.openstack.org/
home-page = http://docs.openstack.org/developer/karbor/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@@ -18,6 +18,7 @@ classifier =
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
[global]
setup-hooks =

View File

@@ -4,10 +4,10 @@
hacking<0.11,>=0.10.2 # Apache-2.0
coverage>=3.6 # Apache-2.0
coverage>=4.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx!=1.3b1,<1.3,>=1.2.1 # BSD
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
oslosphinx>=4.7.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD

View File

@@ -1,6 +1,6 @@
[tox]
minversion = 1.6
envlist = py34,py27,pypy,pep8
envlist = py35,py34,py27,pypy,pep8
skipsdist = True
[testenv]
@@ -37,4 +37,4 @@ commands = oslo_debug_helper {posargs}
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools