Files
python-solumclient/solumclient/v1/client.py
Ed Cranford 29e99e8be7 Adds new app and workflow commands
Old app commands renamed to oldapp

Currently Solum CLI uses 'plan' and 'assembly' resources in the API.
Specifically,

'solum app create' in CLI makes a POST call to '/v1/plans' and
'solum app deploy' in CLI makes a
POST call to '/v1/plans/<plan-id>/assemblies'

Recently we have introduced 'app' and 'workflow' resources in
Solum API. We want to modify the Solum CLI to start using
these resources. Specifically,

'solum app create' in CLI should make a POST call to '/v1/apps' and
'solum app deploy' in CLI should make a
POST call to '/v1/apps/<app-id>/workflows'

Thus, we want to port all the current functionality of
Solum 'app commands' to use 'app' and 'workflow' resources.

One way to do this porting is as follows:

- Rename the current 'app' commands to something else (say, 'oldapp')
- Introduce a new 'app' command manager where the required
functionality is built out
- Port over the functionality from 'oldapp' to the 'app'
- Delete the 'oldapp' command and related code once all the
functionality has been ported over.

Partial-Bug: #1491632

Change-Id: I1404775c458e925ac117ae71b90c10957e21a02a
2015-09-02 17:50:39 -05:00

42 lines
1.6 KiB
Python

# Copyright 2013 - Noorul Islam K M
#
# 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.
from solumclient.openstack.common.apiclient import client
from solumclient.v1 import app
from solumclient.v1 import assembly
from solumclient.v1 import component
from solumclient.v1 import languagepack
from solumclient.v1 import pipeline
from solumclient.v1 import plan
from solumclient.v1 import platform
from solumclient.v1 import workflow
class Client(client.BaseClient):
"""Client for the Solum v1 API."""
service_type = "application_deployment"
def __init__(self, http_client, extensions=None):
"""Initialize a new client for the Solum v1 API."""
super(Client, self).__init__(http_client, extensions)
self.apps = app.AppManager(self)
self.assemblies = assembly.AssemblyManager(self)
self.components = component.ComponentManager(self)
self.pipelines = pipeline.PipelineManager(self)
self.platform = platform.PlatformManager(self)
self.plans = plan.PlanManager(self)
self.languagepacks = languagepack.LanguagePackManager(self)
self.workflows = workflow.WorkflowManager(self)