# 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. # """Orchestration v1 Stack action implementations""" import logging import sys from cliff import command from cliff import lister from cliff import show from openstackclient.common import exceptions as exc from openstackclient.common import parseractions from openstackclient.common import utils from oslo_serialization import jsonutils import six from six.moves.urllib import request from heatclient.common import event_utils from heatclient.common import format_utils from heatclient.common import hook_utils from heatclient.common import http from heatclient.common import template_utils from heatclient.common import utils as heat_utils from heatclient import exc as heat_exc from heatclient.openstack.common._i18n import _ from heatclient.openstack.common._i18n import _LI def _authenticated_fetcher(client): def _do(*args, **kwargs): if isinstance(client.http_client, http.SessionClient): method, url = args return client.http_client.request(url, method, **kwargs).content else: return client.http_client.raw_request(*args, **kwargs).content return _do class CreateStack(show.ShowOne): """Create a stack.""" log = logging.getLogger(__name__ + '.CreateStack') def get_parser(self, prog_name): parser = super(CreateStack, self).get_parser(prog_name) parser.add_argument( '-t', '--template', metavar='