Change Smaug to Karbor

There was a decision in the community to change the project name.

Change-Id: I8b3d538b9573ebaa2a873f4696e1f1a500c941a8
This commit is contained in:
chenying 2016-08-11 20:22:26 +08:00
parent daa947444a
commit 1c60dac7fa
273 changed files with 1449 additions and 1454 deletions

View File

@ -1,7 +1,7 @@
[run] [run]
branch = True branch = True
source = smaug source = karbor
omit = smaug/tests/*,smaug/openstack/* omit = karbor/tests/*,karbor/openstack/*
[report] [report]
ignore_errors = True ignore_errors = True

View File

@ -1,4 +1,4 @@
[gerrit] [gerrit]
host=review.openstack.org host=review.openstack.org
port=29418 port=29418
project=openstack/smaug.git project=openstack/karbor.git

View File

@ -2,6 +2,6 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./smaug/tests/unit} $LISTOPT $IDOPTION ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./karbor/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE test_id_option=--load-list $IDFILE
test_list_option=--list test_list_option=--list

View File

@ -14,4 +14,4 @@ Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub: Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/smaug https://bugs.launchpad.net/karbor

View File

@ -1,4 +1,4 @@
smaug Style Commandments karbor Style Commandments
=============================================== ===============================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

View File

@ -1,6 +1,6 @@
include AUTHORS include AUTHORS
include ChangeLog include ChangeLog
recursive-include smaug *.cfg recursive-include karbor *.cfg
exclude .gitignore exclude .gitignore
exclude .gitreview exclude .gitreview

View File

@ -1,11 +1,11 @@
===== =====
Smaug Karbor
===== =====
Application Data Protection as a Service for OpenStack Application Data Protection as a Service for OpenStack
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/Smaug.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/Karbor.png
:alt: Smaug :alt: Karbor
:width: 300 :width: 300
:height: 525 :height: 525
:align: center :align: center
@ -45,12 +45,12 @@ Links
***** *****
* Free software: Apache license * Free software: Apache license
* Documentation: http://docs.openstack.org/developer/smaug * Documentation: http://docs.openstack.org/developer/karbor
* Source: http://git.openstack.org/cgit/openstack/smaug * Source: http://git.openstack.org/cgit/openstack/karbor
* Bugs: http://bugs.launchpad.net/smaug * Bugs: http://bugs.launchpad.net/karbor
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/SmaugInPieces.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/KarborInPieces.png
:alt: Smaug :alt: Karbor
:width: 200 :width: 200
:height: 525 :height: 525
:align: center :align: center

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -9,10 +9,10 @@
</filter> </filter>
</defs> </defs>
<g> <g>
<text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="175" x="223" y="16.708">Smaug Protectables</text> <text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="175" x="223" y="16.708">Karbor Protectables</text>
<polygon fill="#DDDDDD" points="43.5,28.9531,43.5,104.1406,576.5,104.1406,576.5,28.9531,43.5,28.9531" style="stroke: #000000; stroke-width: 1.0;" /> <polygon fill="#DDDDDD" points="43.5,28.9531,43.5,104.1406,576.5,104.1406,576.5,28.9531,43.5,28.9531" style="stroke: #000000; stroke-width: 1.0;" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="474" x="49.5" y="46.9482">This file contains the dependecy between protectables in the default</text> <text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="474" x="49.5" y="46.9482">This file contains the dependecy between protectables in the default</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="514" x="49.5" y="63.2451">distribution of Smaug. The arrows, similar to inheritance point to the parent</text> <text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="514" x="49.5" y="63.2451">distribution of Karbor. The arrows, similar to inheritance point to the parent</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="521" x="49.5" y="79.542">since Protectables define what types they depend on so this reflects who is</text> <text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="521" x="49.5" y="79.542">since Protectables define what types they depend on so this reflects who is</text>
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="216" x="49.5" y="95.8389">responsible for the connection.</text> <text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="216" x="49.5" y="95.8389">responsible for the connection.</text>
<rect fill="#FEFECE" filter="url(#f1)" height="39.9688" style="stroke: #A80036; stroke-width: 1.5;" width="120" x="6" y="321.1406" /> <rect fill="#FEFECE" filter="url(#f1)" height="39.9688" style="stroke: #A80036; stroke-width: 1.5;" width="120" x="6" y="321.1406" />

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -9,7 +9,7 @@
</filter> </filter>
</defs> </defs>
<g> <g>
<text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="172" x="526.5" y="16.708">"Smaug API model"</text> <text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="172" x="526.5" y="16.708">"Karbor API model"</text>
<rect fill="#FEFECE" filter="url(#f1)" height="86.4141" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="1071" y="519.9531" /> <rect fill="#FEFECE" filter="url(#f1)" height="86.4141" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="1071" y="519.9531" />
<ellipse cx="1099.95" cy="535.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;" /> <ellipse cx="1099.95" cy="535.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;" />
<path d="M1102.9188,541.5938 Q1102.3406,541.8906 1101.7,542.0391 Q1101.0594,542.1875 1100.3563,542.1875 Q1097.8563,542.1875 1096.5359,540.5391 Q1095.2156,538.8906 1095.2156,535.7656 Q1095.2156,532.6406 1096.5359,530.9844 Q1097.8563,529.3281 1100.3563,529.3281 Q1101.0594,529.3281 1101.7078,529.4844 Q1102.3563,529.6406 1102.9188,529.9375 L1102.9188,532.6563 Q1102.2938,532.0781 1101.7,531.8047 Q1101.1063,531.5313 1100.4813,531.5313 Q1099.1375,531.5313 1098.45,532.6016 Q1097.7625,533.6719 1097.7625,535.7656 Q1097.7625,537.8594 1098.45,538.9297 Q1099.1375,540 1100.4813,540 Q1101.1063,540 1101.7,539.7266 Q1102.2938,539.4531 1102.9188,538.875 L1102.9188,541.5938 Z " <path d="M1102.9188,541.5938 Q1102.3406,541.8906 1101.7,542.0391 Q1101.0594,542.1875 1100.3563,542.1875 Q1097.8563,542.1875 1096.5359,540.5391 Q1095.2156,538.8906 1095.2156,535.7656 Q1095.2156,532.6406 1096.5359,530.9844 Q1097.8563,529.3281 1100.3563,529.3281 Q1101.0594,529.3281 1101.7078,529.4844 Q1102.3563,529.6406 1102.9188,529.9375 L1102.9188,532.6563 Q1102.2938,532.0781 1101.7,531.8047 Q1101.1063,531.5313 1100.4813,531.5313 Q1099.1375,531.5313 1098.45,532.6016 Q1097.7625,533.6719 1097.7625,535.7656 Q1097.7625,537.8594 1098.45,538.9297 Q1099.1375,540 1100.4813,540 Q1101.1063,540 1101.7,539.7266 Q1102.2938,539.4531 1102.9188,538.875 L1102.9188,541.5938 Z "

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -1,4 +1,4 @@
# Smaug API # # Karbor API #
---------- ----------

View File

@ -2,17 +2,17 @@
*** :exclamation: This is still a work in progress *** *** :exclamation: This is still a work in progress ***
This document will describe the layout and algorithms used by Smaug using the This document will describe the layout and algorithms used by Karbor using the
default bank implementation. Providers can use their own algorithms to manage default bank implementation. Providers can use their own algorithms to manage
metdata but there might be issues when using default plugins. metdata but there might be issues when using default plugins.
## Abstract ## Abstract
Since Smaug want's to be able to store metadata in many locations (swift, mongodb, etc.) Since Karbor want's to be able to store metadata in many locations (swift, mongodb, etc.)
we defined a simplified object store interface that we believe most backends will be able we defined a simplified object store interface that we believe most backends will be able
to support without much work. to support without much work.
But the simplified interface doesn't describe how Smaug will do it's higher But the simplified interface doesn't describe how Karbor will do it's higher
level operations and how the higher level logic will be laid out in the object level operations and how the higher level logic will be laid out in the object
store. This is why we need higher level logic defined explicitly so that later store. This is why we need higher level logic defined explicitly so that later
we could use higher level bank functions knowing they are correct, safe and atomic. we could use higher level bank functions knowing they are correct, safe and atomic.
@ -80,7 +80,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
* buffer: * buffer:
```json ```json
{ {
"smaug_version": "1.0.0", "karbor_version": "1.0.0",
"status": "in_progress", "status": "in_progress",
"plugins": {} "plugins": {}
} }
@ -92,7 +92,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
* buffer: * buffer:
```json ```json
{ {
"smaug_version": "1.0.0", "karbor_version": "1.0.0",
"status": "creating_indices", "status": "creating_indices",
"plugins": {} "plugins": {}
} }
@ -120,7 +120,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
* buffer: * buffer:
```json ```json
{ {
"smaug_version": "1.0.0", "karbor_version": "1.0.0",
"status": "deleting", "status": "deleting",
"plugins": {} "plugins": {}
} }
@ -131,7 +131,7 @@ or returned by the provider.
## GC ## GC
When deleting a checkpoint the checkpoint is only marked as deleted. On of the When deleting a checkpoint the checkpoint is only marked as deleted. On of the
Smaug server will have to run a GC collection run and make sure all the actual Karbor server will have to run a GC collection run and make sure all the actual
data is free. This is done to unify all the cleanup to one flow and make sure data is free. This is done to unify all the cleanup to one flow and make sure
the deletion has been propagated to all sites before actually deleting the data. the deletion has been propagated to all sites before actually deleting the data.

View File

@ -1,6 +1,6 @@
@startuml @startuml
title "Smaug API model" title "Karbor API model"
class Protectable { class Protectable {
name: string name: string

View File

@ -1,9 +1,9 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: Smaug API title: Karbor API
description: Protect all you hold dear description: Protect all you hold dear
version: 0.99.0 version: 0.99.0
host: api.smaug.nowhere.com host: api.karbor.nowhere.com
schemes: schemes:
- https - https
basePath: /v1 basePath: /v1
@ -729,7 +729,7 @@ paths:
get: get:
summary: Operation log entry point. summary: Operation log entry point.
description: | description: |
Get the information about operation instances in smaug. Get the information about operation instances in karbor.
Whenever an operation is run a log instance is created. Whenever an operation is run a log instance is created.
The user never creates operation logs. The user never creates operation logs.
This should not include the 'entires' property for the operation log. This should not include the 'entires' property for the operation log.

View File

@ -38,7 +38,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'smaug' project = u'karbor'
copyright = u'2013, OpenStack Foundation' copyright = u'2013, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.

View File

@ -1,10 +1,10 @@
================================== ==================================
Smaug: Application Data Protection Karbor: Application Data Protection
================================== ==================================
Introduction Introduction
============ ============
Smaug is an OpenStack project that provides a pluggable framework for Karbor is an OpenStack project that provides a pluggable framework for
protecting and restoring Data and Metadata that comprises an OpenStack-deployed protecting and restoring Data and Metadata that comprises an OpenStack-deployed
application - Application Data Protection as a Service. application - Application Data Protection as a Service.
@ -15,7 +15,7 @@ Application against loss/damage (e.g. backup, replication) by providing a
standard framework of APIs and services that allows vendors to provide plugins standard framework of APIs and services that allows vendors to provide plugins
through a unified interface through a unified interface
Using Smaug Using Karbor
=========== ===========
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
@ -26,7 +26,7 @@ Using Smaug
contributing contributing
releasenotes releasenotes
Smaug Specs Karbor Specs
=========== ===========
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1

View File

@ -4,18 +4,18 @@ Installation
Single-node Devstack Installation Single-node Devstack Installation
================================= =================================
In order to install Smaug using Devstack on a single node, add the following to In order to install Karbor using Devstack on a single node, add the following to
your local.conf, under [[local|localrc]]: your local.conf, under [[local|localrc]]:
.. code-block:: none .. code-block:: none
enable_plugin smaug http://git.openstack.org/openstack/smaug master enable_plugin karbor http://git.openstack.org/openstack/karbor master
enable_plugin smaug-dashboard http://git.openstack.org/openstack/smaug-dashboard master enable_plugin karbor-dashboard http://git.openstack.org/openstack/karbor-dashboard master
enable_service smaug-api enable_service karbor-api
enable_service smaug-operationengine enable_service karbor-operationengine
enable_service smaug-protection enable_service karbor-protection
# Smaug Dashboard depends on Horizon # Karbor Dashboard depends on Horizon
enable_service smaug-dashboard enable_service karbor-dashboard
Depenencies Depenencies
=========== ===========

View File

@ -5,15 +5,15 @@ Introduction
.. contents:: :depth: 2 .. contents:: :depth: 2
What is Smaug? What is Karbor?
============== ==============
Smaug is an OpenStack project that provides a pluggable framework for Karbor is an OpenStack project that provides a pluggable framework for
protecting and restoring Data and Metadata that comprises an OpenStack-deployed protecting and restoring Data and Metadata that comprises an OpenStack-deployed
application - Application Data Protection as a Service. application - Application Data Protection as a Service.
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/Smaug.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/Karbor.png
:alt: Smaug :alt: Karbor
:align: center :align: center
:height: 150px :height: 150px
@ -33,7 +33,7 @@ Typical Use Case: 3-Tier Cloud App
3-Tier Cloud App Web/App/DB 3-Tier Cloud App Web/App/DB
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/3-tirApp.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/3-tirApp.png
:alt: 3-Tier Cloud App :alt: 3-Tier Cloud App
:width: 600 :width: 600
:align: center :align: center
@ -42,13 +42,13 @@ In order to provide full Protection for this typical use case, we would have to
protect many resources, which have some dependency between them. The following protect many resources, which have some dependency between them. The following
diagram demonstrates how this dependency looks, in the form of a tree: diagram demonstrates how this dependency looks, in the form of a tree:
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/resource_tree_architecture.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/resource_tree_architecture.png
:alt: Resource Tree :alt: Resource Tree
:width: 600 :width: 600
:align: center :align: center
These resources can be divided into groups, each of which will be handled by a These resources can be divided into groups, each of which will be handled by a
different plugin in Smaug: different plugin in Karbor:
- Volume - Volume
- VM - VM
@ -62,7 +62,7 @@ Main Concepts
Protection Providers Protection Providers
----------------------- -----------------------
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/ .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
protection_provider.png protection_provider.png
:width: 600 :width: 600
@ -77,7 +77,7 @@ each protection provider exposes what options it provides for each protectable.
This allows the UI to dynamically adapt to each provider and show the user what This allows the UI to dynamically adapt to each provider and show the user what
options are available, what they mean and what values are supported. options are available, what they mean and what values are supported.
This allows us to extend the providers without updates to Smaug and allow This allows us to extend the providers without updates to Karbor and allow
provider implementation to easily add specialize options. provider implementation to easily add specialize options.
Example Example
@ -112,12 +112,12 @@ provider.
There are two main aspect to protection plan. The first is the continuous There are two main aspect to protection plan. The first is the continuous
aspect. When a plans is started it becomes enabled and continues protection aspect. When a plans is started it becomes enabled and continues protection
processes are started and monitored (eg. replication). As long as the plan is processes are started and monitored (eg. replication). As long as the plan is
active Smaug will try and make sure the continuous aspects are active and valid. active Karbor will try and make sure the continuous aspects are active and valid.
The other aspect is point in time protection or, as we call them in Smaug, The other aspect is point in time protection or, as we call them in Karbor,
checkpoints. Checkpoints are saved in the protection provider paired with the checkpoints. Checkpoints are saved in the protection provider paired with the
plan and, as stated, represent a restorable point in time for the plan. When a plan and, as stated, represent a restorable point in time for the plan. When a
checkpoint is created Smaug will store in the protection provider all the checkpoint is created Karbor will store in the protection provider all the
information required to successfully restore the project covered by the plan information required to successfully restore the project covered by the plan
to how it was at that specific point in time. to how it was at that specific point in time.
@ -139,16 +139,16 @@ complex retention plan to automate the creation and deletion of checkpoints.
Protectables Protectables
------------ ------------
Protectabes are any class or type of entity that can be protected by Smaug. Protectabes are any class or type of entity that can be protected by Karbor.
Since setups might have different entities they would like to protect Smaug Since setups might have different entities they would like to protect Karbor
doesn't bind the API to specific entity types. The admin can even add new doesn't bind the API to specific entity types. The admin can even add new
protectables during set up as long as the protection provider can handle those protectables during set up as long as the protection provider can handle those
entities. This flexibility means that Smaug is agnostic to the relationship entities. This flexibility means that Karbor is agnostic to the relationship
between the resources being backed up. between the resources being backed up.
High Level Architecture High Level Architecture
======================= =======================
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/ .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
high_level_architecture.png high_level_architecture.png
:alt: Solution Overview :alt: Solution Overview
:width: 600 :width: 600
@ -157,15 +157,15 @@ High Level Architecture
The system is built from independent services and a scalable *Workflow The system is built from independent services and a scalable *Workflow
engine* that ties them together: engine* that ties them together:
Smaug API Service Karbor API Service
================= =================
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/ .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
smaug-api.png karbor-api.png
:width: 600 :width: 600
These top-level north-bound APIs expose Application Data Protection services to These top-level north-bound APIs expose Application Data Protection services to
the Smaug user. the Karbor user.
The purpose of the services is to maximize flexibility and accommodate for The purpose of the services is to maximize flexibility and accommodate for
(hopefully) any kind of protection for any type of resource, whether it is a (hopefully) any kind of protection for any type of resource, whether it is a
@ -177,21 +177,21 @@ a hardware device, an external database, etc.).
Resource (Protectable) API Resource (Protectable) API
--------------------------- ---------------------------
Enables the Smaug user to access information about which resource types are Enables the Karbor user to access information about which resource types are
protectable (i.e. can be protected by Smaug). In addition, enables the user to protectable (i.e. can be protected by Karbor). In addition, enables the user to
get additional information on each resource type, such as a list of actual get additional information on each resource type, such as a list of actual
instances and their dependencies. instances and their dependencies.
Provider API Provider API
--------------- ---------------
Enables the Smaug user to list available providers and get parameters and Enables the Karbor user to list available providers and get parameters and
result schema super-set for all plugins of a specific Provider. result schema super-set for all plugins of a specific Provider.
Plan API Plan API
-------- --------
This API enables the Smaug user to access the protection Plan registry and do This API enables the Karbor user to access the protection Plan registry and do
the following operations: the following operations:
- Plan CRUD. - Plan CRUD.
@ -201,7 +201,7 @@ the following operations:
Automatic Operation API Automatic Operation API
-------------------------- --------------------------
This API enables the Smaug user to manage protection Operations: This API enables the Karbor user to manage protection Operations:
- Create a checkpoint for a given Protection Plan. - Create a checkpoint for a given Protection Plan.
- Delete unneeded checkpoints from the provider. - Delete unneeded checkpoints from the provider.
@ -210,7 +210,7 @@ This API enables the Smaug user to manage protection Operations:
Checkpoint API Checkpoint API
--------------- ---------------
This API enables the Smaug user to access and manage the checkpoints stored in This API enables the Karbor user to access and manage the checkpoints stored in
the protection provider: the protection provider:
- List all checkpoints given a Bank ID. - List all checkpoints given a Bank ID.
@ -221,11 +221,11 @@ the protection provider:
Restore API Restore API
--------------- ---------------
This API enables the Smaug user restore a checkpoint on to a restore target: This API enables the Karbor user restore a checkpoint on to a restore target:
- Create restored system from a checkpoint. - Create restored system from a checkpoint.
Smaug Schedule Service Karbor Schedule Service
====================== ======================
This subsystem is responsible for scheduling and orchestrating the execution of This subsystem is responsible for scheduling and orchestrating the execution of
@ -256,7 +256,7 @@ triggers to begin the execution of the Plan Orchestration.
It can be done based on a Timer or an Event Collector - Open to implementation. It can be done based on a Timer or an Event Collector - Open to implementation.
In the first version of Smaug reference implementation, it will only provide In the first version of Karbor reference implementation, it will only provide
time-based triggering. time-based triggering.
Scheduled Operation Scheduled Operation
@ -265,7 +265,7 @@ Scheduled Operation
The sub-component of the Schedule Service is responsible for holding the The sub-component of the Schedule Service is responsible for holding the
mapping between a Trigger and Operation(s). mapping between a Trigger and Operation(s).
Smaug Protection Service Karbor Protection Service
======================== ========================
This subsystem is responsible for handling the following tasks: This subsystem is responsible for handling the following tasks:
@ -282,20 +282,20 @@ flow of the plan across all protection providers.
Communication and Meetings Communication and Meetings
========================== ==========================
- Smaug Launchpad Link: \ https://launchpad.net/smaug - Karbor Launchpad Link: \ https://launchpad.net/karbor
- Smaug Code Review: \ https://review.openstack.org/#/q/smaug+status:open,n,z - Karbor Code Review: \ https://review.openstack.org/#/q/karbor+status:open,n,z
- Smaug Code Repository: \ https://github.com/openstack/smaug - Karbor Code Repository: \ https://github.com/openstack/karbor
- Smaug daily IRC Channel: #openstack-smaug - Karbor daily IRC Channel: #openstack-karbor
- Smaug weekly IRC Meeting on **even** Tuesday at 1500 UTC - Karbor weekly IRC Meeting on **even** Tuesday at 1500 UTC
and on **odd** Tuesday at 0900 UTC in and on **odd** Tuesday at 0900 UTC in
#openstack-meeting at freenode: \ #openstack-meeting at freenode: \
https://wiki.openstack.org/wiki/Meetings/smaug https://wiki.openstack.org/wiki/Meetings/karbor
- Smaug Trello Board: \ https://trello.com/b/Sudr4fKT/smaug - Karbor Trello Board: \ https://trello.com/b/Sudr4fKT/karbor
Additional references Additional references
===================== =====================
- `OpenStack Tokyo Summit 2015 talk <http://www.slideshare.net/gampel/openstack-tokyo-talk-application-data-protection-service>`_ - `OpenStack Tokyo Summit 2015 talk <http://www.slideshare.net/gampel/openstack-tokyo-talk-application-data-protection-service>`_
- `OpenStack Austin Summit 2016 talk <https://www.youtube.com/watch?v=_tVYuW_YMB8>`_ - `OpenStack Austin Summit 2016 talk <https://www.youtube.com/watch?v=_tVYuW_YMB8>`_
- `Smaug overview slide <https://docs.google.com/presentation/d/1JYO1VIlTkGTF6lvKEMcsHkaST3mYFxuarpcNTJ3HBhk/edit?usp=sharing>`_ - `Karbor overview slide <https://docs.google.com/presentation/d/1JYO1VIlTkGTF6lvKEMcsHkaST3mYFxuarpcNTJ3HBhk/edit?usp=sharing>`_
- `Smaug overview blog <http://blog.gampel.net/2015/12/smaug-application-data-protection-for.html>`_ - `Karbor overview blog <http://blog.gampel.net/2015/12/karbor-application-data-protection-for.html>`_

View File

@ -10,7 +10,7 @@ API Service
https://review.openstack.org/#/c/266338/ https://review.openstack.org/#/c/266338/
The APIs expose Application Data Protection services to the Smaug user. The APIs expose Application Data Protection services to the Karbor user.
The purpose of the services is to maximize flexibility and accommodate The purpose of the services is to maximize flexibility and accommodate
for (hopefully) any kind of protection for any type of resource, whether for (hopefully) any kind of protection for any type of resource, whether
@ -27,35 +27,35 @@ WSGI Resources Controller
The WSGI Controller handles incoming web requests that are dispatched The WSGI Controller handles incoming web requests that are dispatched
from the WSGI application APIRouter. from the WSGI application APIRouter.
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/api-service-class-diagram.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/api-service-class-diagram.png
From the module class graph, api service basically have following From the module class graph, api service basically have following
resources Controller: resources Controller:
Provider Controller Provider Controller
--------------------------- ---------------------------
Enables the Smaug user to list available providers and get parameters and Enables the Karbor user to list available providers and get parameters and
result schema super-set for all plugins of a specific Provider. result schema super-set for all plugins of a specific Provider.
Checkpoint Controller Checkpoint Controller
--------------------------- ---------------------------
Enables the Smaug user to access and manage the checkpoints stored Enables the Karbor user to access and manage the checkpoints stored
in the protection provider. in the protection provider.
Protectable Controller Protectable Controller
--------------------------- ---------------------------
Enables the Smaug user to access information about which resource types Enables the Karbor user to access information about which resource types
are protectable (i.e. can be protected by Smaug). are protectable (i.e. can be protected by Karbor).
In addition, enables the user to get additional information on each In addition, enables the user to get additional information on each
resource type, such as a list of actual instances and their dependencies. resource type, such as a list of actual instances and their dependencies.
Plan Controller Plan Controller
--------------------------- ---------------------------
This API enables the Smaug user to access the protection Plan registry This API enables the Karbor user to access the protection Plan registry
and do the following operations: and do the following operations:
- Plan CRUD. - Plan CRUD.
- List Plans. - List Plans.
@ -65,7 +65,7 @@ and do the following operations:
Scheduled Operation Controller Scheduled Operation Controller
-------------------------- --------------------------
This API enables the Smaug user to manage Scheduled Operations: This API enables the Karbor user to manage Scheduled Operations:
- Operation CRUD. - Operation CRUD.
- List Operations. - List Operations.
@ -73,7 +73,7 @@ This API enables the Smaug user to manage Scheduled Operations:
Trigger Controller Trigger Controller
-------------------------- --------------------------
This API enables the Smaug user to manage Triggers: This API enables the Karbor user to manage Triggers:
A trigger only can be deleted when it isn't used in any of the A trigger only can be deleted when it isn't used in any of the
scheduled operation. scheduled operation.
- Trigger CRUD. - Trigger CRUD.
@ -83,7 +83,7 @@ scheduled operation.
Restore Controller Restore Controller
--------------------------- ---------------------------
This API enables the Smaug user restore a checkpoint on to a restore target: This API enables the Karbor user restore a checkpoint on to a restore target:
- Create restored system from a checkpoint. - Create restored system from a checkpoint.

View File

@ -1,12 +1,12 @@
@startuml @startuml
title Smaug Protectables title Karbor Protectables
hide circle hide circle
legend top legend top
This file contains the dependency between protectables in the default This file contains the dependency between protectables in the default
distribution of Smaug. The arrows, similar to inheritance point to the parent distribution of Karbor. The arrows, similar to inheritance point to the parent
since Protectables define what types they depend on so this reflects who is since Protectables define what types they depend on so this reflects who is
responsible for the connection. responsible for the connection.
endlegend endlegend

View File

@ -7,7 +7,7 @@
================= =================
Bank Plugin Basic Bank Plugin Basic
================= =================
Bank Plugin is a component of smaug (an openstack project working as a service for data protection), Bank Plugin is a component of karbor (an openstack project working as a service for data protection),
which is responsible for execute CRUD actions in Bank. which is responsible for execute CRUD actions in Bank.
The bank is a backend (such as swift) which is used to store the metadata/data of protection plan. The bank is a backend (such as swift) which is used to store the metadata/data of protection plan.
@ -19,7 +19,7 @@ leases
Smuag will create a checkpoint when protecting a protection plan. This checkpoint is maintained with Smuag will create a checkpoint when protecting a protection plan. This checkpoint is maintained with
status, which is a enum type: protecting, available, restoring, deleted, etc. status, which is a enum type: protecting, available, restoring, deleted, etc.
The status is used for smaug API layer to control access to one checkpoint from users. The status is used for karbor API layer to control access to one checkpoint from users.
With the 'protecting' status, there're two cases which we can't tell the difference: With the 'protecting' status, there're two cases which we can't tell the difference:

View File

@ -1,8 +1,8 @@
Smaug Specs Karbor Specs
=========== ===========
This section contains detailed specification documents for This section contains detailed specification documents for
different features inside Smaug. different features inside Karbor.
Contents: Contents:

View File

@ -8,9 +8,9 @@
Operation Engine Operation Engine
================ ================
https://blueprints.launchpad.net/smaug/+spec/operation-engine-design https://blueprints.launchpad.net/karbor/+spec/operation-engine-design
Operation Engine is one of components in Smaug, which is responsible for Operation Engine is one of components in Karbor, which is responsible for
triggering the operations to execute when the time is up or event happens. triggering the operations to execute when the time is up or event happens.
Problem description Problem description

View File

@ -22,7 +22,7 @@
Pluggable Protection Provider Pluggable Protection Provider
========================================== ==========================================
https://blueprints.launchpad.net/smaug/+spec/protection-plugin-is-design https://blueprints.launchpad.net/karbor/+spec/protection-plugin-is-design
Protection Provider Protection Provider
=================== ===================
@ -63,7 +63,7 @@ Protection Provider Configuration
Protection Providers are loaded from configuration files, placed in the Protection Providers are loaded from configuration files, placed in the
directory specified by the ``provider_config_dir`` configuration option (by directory specified by the ``provider_config_dir`` configuration option (by
default: ``/etc/smaug/providers.d``). Each provider configuration file must default: ``/etc/karbor/providers.d``). Each provider configuration file must
bear the ``.conf`` suffix and contain a ``[provider]`` section. This section bear the ``.conf`` suffix and contain a ``[provider]`` section. This section
specifies the following configuration: specifies the following configuration:
@ -85,11 +85,11 @@ For example::
name = Foo name = Foo
id = 2e0c8826-81d6-44f5-bbe5-8f46a98c5845 id = 2e0c8826-81d6-44f5-bbe5-8f46a98c5845
description = Example Protection Provider description = Example Protection Provider
bank = smaug.protections.smaug-swift-bank-plugin bank = karbor.protections.karbor-swift-bank-plugin
plugin = smaug.protections.smaug-volume-protection-plugin plugin = karbor.protections.karbor-volume-protection-plugin
plugin = smaug.protections.smaug-image-protection-plugin plugin = karbor.protections.karbor-image-protection-plugin
plugin = smaug.protections.smaug-server-protection-plugin plugin = karbor.protections.karbor-server-protection-plugin
plugin = smaug.protections.smaug-project-protection-plugin plugin = karbor.protections.karbor-project-protection-plugin
[swift_client] [swift_client]
bank_swift_auth_url = http://10.0.0.10:5000 bank_swift_auth_url = http://10.0.0.10:5000
@ -166,7 +166,7 @@ Notes:
else: else:
yield yield
.. figure:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/activities-links.png .. figure:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/activities-links.png
:alt: Activities Links :alt: Activities Links
:align: center :align: center
@ -186,11 +186,11 @@ This scheme decouples the tree structure from the task execution. A plugin that
handles multiple resources or that aggregates multiple resources to one task can handles multiple resources or that aggregates multiple resources to one task can
use this mechanism to only return tasks when appropriate for it's scheme. use this mechanism to only return tasks when appropriate for it's scheme.
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/pluggable_protection_provider.svg .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/pluggable_protection_provider.svg
:alt: Smaug :alt: Karbor
:align: center :align: center
References References
========== ==========
1. `Class Diagram Source <http://raw.githubusercontent.com/openstack/smaug/master/doc/images/specs/pluggable_protection_provider.pu>`_ 1. `Class Diagram Source <http://raw.githubusercontent.com/openstack/karbor/master/doc/images/specs/pluggable_protection_provider.pu>`_
2. `Dependency graph building algorithm <https://docs.google.com/document/d/1Mkd9RgUVdiRL6iei8Nqzzx4xteKIcd-yjMLEkV4Jc9s/edit#>`_ 2. `Dependency graph building algorithm <https://docs.google.com/document/d/1Mkd9RgUVdiRL6iei8Nqzzx4xteKIcd-yjMLEkV4Jc9s/edit#>`_

View File

@ -16,7 +16,7 @@
width="630" width="630"
height="400" height="400"
style="fill:none;stroke:none;stroke-linecap:square;stroke-miterlimit:10" style="fill:none;stroke:none;stroke-linecap:square;stroke-miterlimit:10"
inkscape:export-filename="/home/yuvalbr/src/smaug/doc/images/protection-service/activities-links.png" inkscape:export-filename="/home/yuvalbr/src/karbor/doc/images/protection-service/activities-links.png"
inkscape:export-xdpi="90" inkscape:export-xdpi="90"
inkscape:export-ydpi="90"> inkscape:export-ydpi="90">
<metadata <metadata

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -2,7 +2,7 @@
title create_checkpoint - API RPC call Sequence Diagram title create_checkpoint - API RPC call Sequence Diagram
Smaug_API_Service ->> ProtectionManager :create_checkpoint(backup_plan, protect) Karbor_API_Service ->> ProtectionManager :create_checkpoint(backup_plan, protect)
ProtectionManager -> WorkflowEngine:built task flow ProtectionManager -> WorkflowEngine:built task flow
ProtectionManager -> WorkflowEngine: execute task flow ProtectionManager -> WorkflowEngine: execute task flow
WorkflowEngine -> CreateCheckpointTask:execute() WorkflowEngine -> CreateCheckpointTask:execute()

View File

@ -8,13 +8,13 @@
Protection Service Basics Protection Service Basics
==================================== ====================================
https://bugs.launchpad.net/smaug/+bug/1529199 https://bugs.launchpad.net/karbor/+bug/1529199
Protection Service is a component of smaug (an openstack project working as a Protection Service is a component of karbor (an openstack project working as a
service for data protection), which is responsible to execute service for data protection), which is responsible to execute
protect/restore/other actions on operations (triggered plans). protect/restore/other actions on operations (triggered plans).
Architecturally, it acts as a RPC server role for smaug API service to actually Architecturally, it acts as a RPC server role for karbor API service to actually
execute the actions on triggered operations. execute the actions on triggered operations.
It's also the role who actually cooperates with protection plugins provided by It's also the role who actually cooperates with protection plugins provided by
@ -29,7 +29,7 @@ the graph task flow.
RPC interfaces RPC interfaces
================================================ ================================================
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/protection-architecture.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/protection-architecture.png
From the module graph, protection service basically provide following RPC From the module graph, protection service basically provide following RPC
calls: calls:
@ -56,7 +56,7 @@ Checkpoint RPC:
Main Concept Main Concept
============ ============
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/class-diagram.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/class-diagram.png
Protection Manager Protection Manager
@ -80,7 +80,7 @@ CheckpointCollection
-------------------- --------------------
Entity to manage checkpoints, which provides CRUD interfaces to handle Entity to manage checkpoints, which provides CRUD interfaces to handle
checkpoint. As checkpoint is a smaug internal entity, one checkpoint operation checkpoint. As checkpoint is a karbor internal entity, one checkpoint operation
is actually composed by combination of several BankPlugin atomic operations. is actually composed by combination of several BankPlugin atomic operations.
Take create_checkpoint as example, it will first acquire write lease (there Take create_checkpoint as example, it will first acquire write lease (there
@ -96,9 +96,9 @@ call to Protection Service.
Let's take action protect as the example and analyze the sequence together with Let's take action protect as the example and analyze the sequence together with
the class graph: the class graph:
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/protection-service/protect-rpc-call-seq-diagram.png .. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/protection-service/protect-rpc-call-seq-diagram.png
1. Smaug **Operation Engine** 1. Karbor **Operation Engine**
------------------------------ ------------------------------
who is responsible for triggering operation according to time schedule or who is responsible for triggering operation according to time schedule or
events, will call RPC call of Protection Service: events, will call RPC call of Protection Service:

View File

@ -10,7 +10,7 @@ Example Spec - The title of your RFE
Include the URL of your launchpad RFE: Include the URL of your launchpad RFE:
https://bugs.launchpad.net/smaug/+bug/example-id https://bugs.launchpad.net/karbor/+bug/example-id
Introduction paragraph -- why are we doing this feature? A single paragraph of Introduction paragraph -- why are we doing this feature? A single paragraph of
prose that **deployers, and developers, and operators** can understand. prose that **deployers, and developers, and operators** can understand.
@ -44,7 +44,7 @@ design at the same time as use cases, if desired. Note that by high-level,
we mean the "view from orbit" rough cut at how things will happen. we mean the "view from orbit" rough cut at how things will happen.
This section should 'scope' the effort from a feature standpoint: how is the This section should 'scope' the effort from a feature standpoint: how is the
'Smaug end-to-end system' going to look like after this change? What Smaug 'Karbor end-to-end system' going to look like after this change? What Karbor
areas do you intend to touch and how do you intend to work on them? areas do you intend to touch and how do you intend to work on them?
@ -143,7 +143,7 @@ but we're mostly trying to understand the timeline for implementation.
Dependencies Dependencies
============ ============
* Include specific references to specs and/or blueprints in Smaug, or in other * Include specific references to specs and/or blueprints in Karbor, or in other
projects, that this one either depends on or is related to. projects, that this one either depends on or is related to.
* If this requires functionality of another project that is not currently used * If this requires functionality of another project that is not currently used

View File

@ -1,12 +1,12 @@
============= =============
Usage Example Usage Example
============= =============
Resources in OpenStack (server, volume, image, network, etc) can be protected by Smaug. Resources in OpenStack (server, volume, image, network, etc) can be protected by Karbor.
This example will show protecting volume. This example will show protecting volume.
#. Before starting the smaug-protection service, the admin needs to configure a #. Before starting the karbor-protection service, the admin needs to configure a
Provider in /etc/smaug/providers.d/openstack-infra.conf. The Swift plugin is Provider in /etc/karbor/providers.d/openstack-infra.conf. The Swift plugin is
the default bank plugin. The admin also needs to configure the basic Swift the default bank plugin. The admin also needs to configure the basic Swift
client account configuration:: client account configuration::
@ -15,8 +15,8 @@ This example will show protecting volume.
name = OS Infra Provider name = OS Infra Provider
description = This provider uses OpenStack's own services (swift, cinder) as storage description = This provider uses OpenStack's own services (swift, cinder) as storage
id = cf56bd3e-97a7-4078-b6d5-f36246333fd9 id = cf56bd3e-97a7-4078-b6d5-f36246333fd9
plugin=smaug-volume-protection-plugin plugin=karbor-volume-protection-plugin
bank=smaug-swift-bank-plugin bank=karbor-swift-bank-plugin
[swift_client] [swift_client]
swift_auth_url=http://10.229.47.230:5000/v2.0/ swift_auth_url=http://10.229.47.230:5000/v2.0/
@ -27,7 +27,7 @@ This example will show protecting volume.
#. To use cinder or smaug client, we should provide Keystone authentication #. To use cinder or karbor client, we should provide Keystone authentication
variables:: variables::
export OS_USERNAME=admin export OS_USERNAME=admin
@ -37,7 +37,7 @@ This example will show protecting volume.
#. Show the provider information:: #. Show the provider information::
smaug provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 karbor provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value | | Property | Value |
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -61,7 +61,7 @@ This example will show protecting volume.
#. List the protectable resources:: #. List the protectable resources::
smaug protectable-list karbor protectable-list
+-----------------------+ +-----------------------+
| Protectable type | | Protectable type |
+-----------------------+ +-----------------------+
@ -70,7 +70,7 @@ This example will show protecting volume.
| OS::Nova::Server | | OS::Nova::Server |
+-----------------------+ +-----------------------+
smaug protectable-list-instances OS::Cinder::Volume karbor protectable-list-instances OS::Cinder::Volume
+--------------------------------------+--------------------+---------------------+ +--------------------------------------+--------------------+---------------------+
| Id | Type | Dependent resources | | Id | Type | Dependent resources |
+--------------------------------------+--------------------+---------------------+ +--------------------------------------+--------------------+---------------------+
@ -81,7 +81,7 @@ This example will show protecting volume.
#. Create a protection plan with a provider and resources:: #. Create a protection plan with a provider and resources::
smaug plan-create 'OS volumes protection plan.' 'cf56bd3e-97a7-4078-b6d5-f36246333fd9' 'd107b234-e16d-4e1e-800d-86523c693e5c'='OS::Cinder::Volume'='volume2','c468688b-dcb1-4bdf-b26b-62e989ac940e'='OS::Cinder::Volume'='volume1' karbor plan-create 'OS volumes protection plan.' 'cf56bd3e-97a7-4078-b6d5-f36246333fd9' 'd107b234-e16d-4e1e-800d-86523c693e5c'='OS::Cinder::Volume'='volume2','c468688b-dcb1-4bdf-b26b-62e989ac940e'='OS::Cinder::Volume'='volume1'
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value | | Property | Value |
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -95,7 +95,7 @@ This example will show protecting volume.
#. Execute a protect operation manually with a plan:: #. Execute a protect operation manually with a plan::
smaug checkpoint-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 b5969bb9-c571-4538-b827-3746d11aa7a2 karbor checkpoint-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 b5969bb9-c571-4538-b827-3746d11aa7a2
+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value | | Property | Value |
@ -115,18 +115,18 @@ This example will show protecting volume.
| 58811e5a-d65f-4d1e-8e3d-2e7f1b688c32 | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | test_protect | 1 | 22 | volumebackups | | 58811e5a-d65f-4d1e-8e3d-2e7f1b688c32 | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | test_protect | 1 | 22 | volumebackups |
| de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups | | de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups |
+--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+
smaug checkpoint-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 503e12db-a815-4101-b526-6b687ba60080 karbor checkpoint-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 503e12db-a815-4101-b526-6b687ba60080
#. Execute a protect operation automatically with a scheduler:: #. Execute a protect operation automatically with a scheduler::
smaug trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2":"format"="crontab" karbor trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2":"format"="crontab"
smaug scheduledoperation-create 'Protect with My Trigger' 'protect' <trigger_id> "plan_id"="b5969bb9-c571-4538-b827-3746d11aa7a2":"provider_id"="cf56bd3e-97a7-4078-b6d5-f36246333fd9" karbor scheduledoperation-create 'Protect with My Trigger' 'protect' <trigger_id> "plan_id"="b5969bb9-c571-4538-b827-3746d11aa7a2":"provider_id"="cf56bd3e-97a7-4078-b6d5-f36246333fd9"
#. Execute a restore operation manually with a checkpoint id:: #. Execute a restore operation manually with a checkpoint id::
smaug --debug restore-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 'http://10.229.47.230:35357/v2.0/' --parameters 'username'='admin' 'password'='123456' karbor --debug restore-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 'http://10.229.47.230:35357/v2.0/' --parameters 'username'='admin' 'password'='123456'
+----------------+-------------------------------------------------+ +----------------+-------------------------------------------------+
| Property | Value | | Property | Value |
+----------------+-------------------------------------------------+ +----------------+-------------------------------------------------+
@ -159,7 +159,7 @@ This example will show protecting volume.
| de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups | | de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups |
+--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+
smaug checkpoint-delete cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 karbor checkpoint-delete cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7
cinder backup-list cinder backup-list
+----+-----------+--------+------+------+--------------+-----------+ +----+-----------+--------+------+------+--------------+-----------+

View File

@ -2,13 +2,13 @@
# OpenStack # # OpenStack #
############# #############
[composite:osapi_smaug] [composite:osapi_karbor]
use = egg:Paste#urlmap use = egg:Paste#urlmap
/: apiversions /: apiversions
/v1: openstack_smaug_api_v1 /v1: openstack_karbor_api_v1
[composite:openstack_smaug_api_v1] [composite:openstack_karbor_api_v1]
use = call:smaug.api.middleware.auth:pipeline_factory use = call:karbor.api.middleware.auth:pipeline_factory
noauth = request_id catch_errors noauth apiv1 noauth = request_id catch_errors noauth apiv1
keystone = request_id catch_errors authtoken keystonecontext apiv1 keystone = request_id catch_errors authtoken keystonecontext apiv1
@ -19,16 +19,16 @@ paste.filter_factory = oslo_middleware:RequestId.factory
paste.filter_factory = oslo_middleware:CatchErrors.factory paste.filter_factory = oslo_middleware:CatchErrors.factory
[filter:noauth] [filter:noauth]
paste.filter_factory = smaug.api.middleware.auth:NoAuthMiddleware.factory paste.filter_factory = karbor.api.middleware.auth:NoAuthMiddleware.factory
[filter:keystonecontext] [filter:keystonecontext]
paste.filter_factory = smaug.api.middleware.auth:SmaugKeystoneContext.factory paste.filter_factory = karbor.api.middleware.auth:KarborKeystoneContext.factory
[filter:authtoken] [filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory paste.filter_factory = keystonemiddleware.auth_token:filter_factory
[app:apiversions] [app:apiversions]
paste.app_factory = smaug.api.versions:Versions.factory paste.app_factory = karbor.api.versions:Versions.factory
[app:apiv1] [app:apiv1]
paste.app_factory = smaug.api.v1.router:APIRouter.factory paste.app_factory = karbor.api.v1.router:APIRouter.factory

View File

@ -1,17 +1,17 @@
[keystone_authtoken] [keystone_authtoken]
#signing_dir = /var/cache/smaug #signing_dir = /var/cache/karbor
#cafile = /opt/stack/data/ca-bundle.pem #cafile = /opt/stack/data/ca-bundle.pem
#auth_uri = http://192.168.1.102:5000 #auth_uri = http://192.168.1.102:5000
#project_domain_id = default #project_domain_id = default
#project_name = service #project_name = service
#user_domain_id = default #user_domain_id = default
#password = nomoresecrete #password = nomoresecrete
#username = smaug #username = karbor
#auth_url = http://http://192.168.1.102:35357 #auth_url = http://http://192.168.1.102:35357
#auth_plugin = password #auth_plugin = password
[DEFAULT] [DEFAULT]
#api_paste_config = /etc/smaug/api-paste.ini #api_paste_config = /etc/karbor/api-paste.ini
#logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s%(color)s] %(instance)s%(color)s%(message)s #logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s%(color)s] %(instance)s%(color)s%(message)s
#logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d #logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
#logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s #logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s
@ -23,7 +23,7 @@
#rpc_backend = rabbit #rpc_backend = rabbit
#[database] #[database]
#connection = mysql+pymysql://root:stackdb@127.0.0.1/smaug?charset=utf8 #connection = mysql+pymysql://root:stackdb@127.0.0.1/karbor?charset=utf8
#[oslo_messaging_rabbit] #[oslo_messaging_rabbit]
#rabbit_userid = stackrabbit #rabbit_userid = stackrabbit

View File

@ -3,9 +3,9 @@ name = OS Infra Provider
description = This provider uses OpenStack's own services (swift, cinder) as storage description = This provider uses OpenStack's own services (swift, cinder) as storage
id = cf56bd3e-97a7-4078-b6d5-f36246333fd9 id = cf56bd3e-97a7-4078-b6d5-f36246333fd9
plugin=smaug-volume-protection-plugin plugin=karbor-volume-protection-plugin
plugin=smaug-image-protection-plugin plugin=karbor-image-protection-plugin
bank=smaug-swift-bank-plugin bank=karbor-swift-bank-plugin
[swift_client] [swift_client]
swift_auth_url=http://127.0.0.1:5000/v2.0/ swift_auth_url=http://127.0.0.1:5000/v2.0/

View File

@ -16,4 +16,4 @@ import pbr.version
__version__ = pbr.version.VersionInfo( __version__ = pbr.version.VersionInfo(
'smaug').version_string() 'karbor').version_string()

View File

@ -19,7 +19,7 @@ from oslo_log import log as logging
from six.moves import urllib from six.moves import urllib
import webob import webob
from smaug.i18n import _ from karbor.i18n import _
api_common_opts = [ api_common_opts = [
@ -159,7 +159,7 @@ def get_sort_params(params, default_key='created_at', default_dir='desc'):
function. function.
:param params: webob.multidict of request parameters (from :param params: webob.multidict of request parameters (from
smaug.api.openstack.wsgi.Request.params) karbor.api.openstack.wsgi.Request.params)
:param default_key: default sort key value, added to the list if no :param default_key: default sort key value, added to the list if no
sort keys are supplied sort keys are supplied
:param default_dir: default sort dir value, added to the list if the :param default_dir: default sort dir value, added to the list if the
@ -204,11 +204,11 @@ def get_request_url(request):
def remove_version_from_href(href): def remove_version_from_href(href):
"""Removes the first api version from the href. """Removes the first api version from the href.
Given: 'http://www.smaug.com/v1.1/123' Given: 'http://www.karbor.com/v1.1/123'
Returns: 'http://www.smaug.com/123' Returns: 'http://www.karbor.com/123'
Given: 'http://www.smaug.com/v1.1' Given: 'http://www.karbor.com/v1.1'
Returns: 'http://www.smaug.com' Returns: 'http://www.karbor.com'
""" """
parsed_url = urllib.parse.urlsplit(href) parsed_url = urllib.parse.urlsplit(href)
@ -249,7 +249,7 @@ class ViewBuilder(object):
prefix = self._update_link_prefix(get_request_url(request), prefix = self._update_link_prefix(get_request_url(request),
CONF.osapi_plan_base_URL) CONF.osapi_plan_base_URL)
url = os.path.join(prefix, url = os.path.join(prefix,
request.environ["smaug.context"].project_id, request.environ["karbor.context"].project_id,
collection_name) collection_name)
return "%s?%s" % (url, urllib.parse.urlencode(params)) return "%s?%s" % (url, urllib.parse.urlencode(params))
@ -258,7 +258,7 @@ class ViewBuilder(object):
prefix = self._update_link_prefix(get_request_url(request), prefix = self._update_link_prefix(get_request_url(request),
CONF.osapi_plan_base_URL) CONF.osapi_plan_base_URL)
return os.path.join(prefix, return os.path.join(prefix,
request.environ["smaug.context"].project_id, request.environ["karbor.context"].project_id,
self._collection_name, self._collection_name,
str(identifier)) str(identifier))
@ -268,7 +268,7 @@ class ViewBuilder(object):
base_url = self._update_link_prefix(base_url, base_url = self._update_link_prefix(base_url,
CONF.osapi_plan_base_URL) CONF.osapi_plan_base_URL)
return os.path.join(base_url, return os.path.join(base_url,
request.environ["smaug.context"].project_id, request.environ["karbor.context"].project_id,
self._collection_name, self._collection_name,
str(identifier)) str(identifier))

View File

@ -27,10 +27,10 @@ from oslo_serialization import jsonutils
import webob.dec import webob.dec
import webob.exc import webob.exc
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import context from karbor import context
from smaug.i18n import _ from karbor.i18n import _
from smaug.wsgi import common as base_wsgi from karbor.wsgi import common as base_wsgi
use_forwarded_for_opt = cfg.BoolOpt( use_forwarded_for_opt = cfg.BoolOpt(
@ -58,7 +58,7 @@ def pipeline_factory(loader, global_conf, **local_conf):
class InjectContext(base_wsgi.Middleware): class InjectContext(base_wsgi.Middleware):
"""Add a 'smaug.context' to WSGI environ.""" """Add a 'karbor.context' to WSGI environ."""
def __init__(self, context, *args, **kwargs): def __init__(self, context, *args, **kwargs):
self.context = context self.context = context
@ -66,11 +66,11 @@ class InjectContext(base_wsgi.Middleware):
@webob.dec.wsgify(RequestClass=base_wsgi.Request) @webob.dec.wsgify(RequestClass=base_wsgi.Request)
def __call__(self, req): def __call__(self, req):
req.environ['smaug.context'] = self.context req.environ['karbor.context'] = self.context
return self.application return self.application
class SmaugKeystoneContext(base_wsgi.Middleware): class KarborKeystoneContext(base_wsgi.Middleware):
"""Make a request context from keystone headers.""" """Make a request context from keystone headers."""
@webob.dec.wsgify(RequestClass=base_wsgi.Request) @webob.dec.wsgify(RequestClass=base_wsgi.Request)
@ -125,7 +125,7 @@ class SmaugKeystoneContext(base_wsgi.Middleware):
request_id=req_id, request_id=req_id,
auth_token_info=auth_token_info) auth_token_info=auth_token_info)
environ['smaug.context'] = ctx environ['karbor.context'] = ctx
return self.application return self.application
@ -159,5 +159,5 @@ class NoAuthMiddleware(base_wsgi.Middleware):
is_admin=True, is_admin=True,
remote_address=remote_address) remote_address=remote_address)
req.environ['smaug.context'] = ctx req.environ['karbor.context'] = ctx
return self.application return self.application

View File

@ -20,11 +20,11 @@ from oslo_utils import excutils
import six import six
import webob import webob
from smaug import exception from karbor import exception
from smaug import i18n from karbor import i18n
from smaug.i18n import _, _LE, _LI from karbor.i18n import _, _LE, _LI
from smaug import utils from karbor import utils
from smaug.wsgi import common as wsgi from karbor.wsgi import common as wsgi
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -620,7 +620,7 @@ class Resource(wsgi.Application):
action_args.update(contents) action_args.update(contents)
project_id = action_args.pop("project_id", None) project_id = action_args.pop("project_id", None)
context = request.environ.get('smaug.context') context = request.environ.get('karbor.context')
if (context and project_id and (project_id != context.project_id)): if (context and project_id and (project_id != context.project_id)):
msg = _("Malformed request url") msg = _("Malformed request url")
return Fault(webob.exc.HTTPBadRequest(explanation=msg)) return Fault(webob.exc.HTTPBadRequest(explanation=msg))
@ -962,7 +962,7 @@ class Fault(webob.exc.HTTPException):
def _set_request_id_header(req, headers): def _set_request_id_header(req, headers):
context = req.environ.get('smaug.context') context = req.environ.get('karbor.context')
if context: if context:
headers['x-compute-request-id'] = context.request_id headers['x-compute-request-id'] = context.request_id

View File

@ -18,17 +18,17 @@ from oslo_utils import uuidutils
from webob import exc from webob import exc
import smaug import karbor
from smaug.api import common from karbor.api import common
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import exception from karbor import exception
from smaug.i18n import _, _LI from karbor.i18n import _, _LI
from smaug import objects from karbor import objects
from smaug.objects import base as objects_base from karbor.objects import base as objects_base
import smaug.policy import karbor.policy
from smaug.services.operationengine import api as operationengine_api from karbor.services.operationengine import api as operationengine_api
from smaug import utils from karbor import utils
import six import six
@ -50,7 +50,7 @@ def check_policy(context, action, target_obj=None):
'user_id': context.user_id, 'user_id': context.user_id,
} }
if isinstance(target_obj, objects_base.SmaugObject): if isinstance(target_obj, objects_base.KarborObject):
# Turn object into dict so target.update can work # Turn object into dict so target.update can work
target.update( target.update(
target_obj.obj_to_primitive() or {}) target_obj.obj_to_primitive() or {})
@ -58,7 +58,7 @@ def check_policy(context, action, target_obj=None):
target.update(target_obj or {}) target.update(target_obj or {})
_action = 'plan:%s' % action _action = 'plan:%s' % action
smaug.policy.enforce(context, _action, target) karbor.policy.enforce(context, _action, target)
class PlanViewBuilder(common.ViewBuilder): class PlanViewBuilder(common.ViewBuilder):
@ -126,7 +126,7 @@ class PlansController(wsgi.Controller):
def show(self, req, id): def show(self, req, id):
"""Return data about the given plan.""" """Return data about the given plan."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show plan with id: %s"), id, context=context) LOG.info(_LI("Show plan with id: %s"), id, context=context)
@ -145,7 +145,7 @@ class PlansController(wsgi.Controller):
def delete(self, req, id): def delete(self, req, id):
"""Delete a plan.""" """Delete a plan."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Delete plan with id: %s"), id, context=context) LOG.info(_LI("Delete plan with id: %s"), id, context=context)
@ -161,7 +161,7 @@ class PlansController(wsgi.Controller):
def index(self, req): def index(self, req):
"""Returns a list of plans, transformed through view builder.""" """Returns a list of plans, transformed through view builder."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show plan list"), context=context) LOG.info(_LI("Show plan list"), context=context)
@ -236,7 +236,7 @@ class PlansController(wsgi.Controller):
raise exc.HTTPUnprocessableEntity() raise exc.HTTPUnprocessableEntity()
LOG.debug('Create plan request body: %s', body) LOG.debug('Create plan request body: %s', body)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
check_policy(context, 'create') check_policy(context, 'create')
plan = body['plan'] plan = body['plan']
LOG.debug('Create plan request plan: %s', plan) LOG.debug('Create plan request plan: %s', plan)
@ -278,7 +278,7 @@ class PlansController(wsgi.Controller):
def update(self, req, id, body): def update(self, req, id, body):
"""Update a plan.""" """Update a plan."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
if not body: if not body:
msg = _("Missing request body") msg = _("Missing request body")
@ -333,7 +333,7 @@ class PlansController(wsgi.Controller):
try: try:
check_policy(context, 'get', plan) check_policy(context, 'get', plan)
except exception.PolicyNotAuthorized: except exception.PolicyNotAuthorized:
# raise PlanNotFound instead to make sure smaug behaves # raise PlanNotFound instead to make sure karbor behaves
# as it used to # as it used to
raise exception.PlanNotFound(plan_id=plan_id) raise exception.PlanNotFound(plan_id=plan_id)
LOG.info(_LI("Plan info retrieved successfully."), resource=plan) LOG.info(_LI("Plan info retrieved successfully."), resource=plan)
@ -347,13 +347,13 @@ class PlansController(wsgi.Controller):
raise exception.InvalidPlan(reason=msg) raise exception.InvalidPlan(reason=msg)
# TODO(chenying) replication scene: need call rpc API when # TODO(chenying) replication scene: need call rpc API when
# the status of the plan is changed. # the status of the plan is changed.
if isinstance(plan, objects_base.SmaugObject): if isinstance(plan, objects_base.KarborObject):
plan.update(fields) plan.update(fields)
plan.save() plan.save()
LOG.info(_LI("Plan updated successfully."), resource=plan) LOG.info(_LI("Plan updated successfully."), resource=plan)
else: else:
msg = _("The parameter plan must be a object of " msg = _("The parameter plan must be a object of "
"SmaugObject class.") "KarborObject class.")
raise exception.InvalidInput(reason=msg) raise exception.InvalidInput(reason=msg)
def validate_plan_resources(self, plan): def validate_plan_resources(self, plan):

View File

@ -17,14 +17,14 @@ from oslo_log import log as logging
from webob import exc from webob import exc
from smaug.api import common from karbor.api import common
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import exception from karbor import exception
from smaug.i18n import _, _LI from karbor.i18n import _, _LI
import smaug.policy import karbor.policy
from smaug.services.protection import api as protection_api from karbor.services.protection import api as protection_api
from smaug import utils from karbor import utils
import six import six
@ -46,7 +46,7 @@ def check_policy(context, action):
'user_id': context.user_id, 'user_id': context.user_id,
} }
_action = 'protectable:%s' % action _action = 'protectable:%s' % action
smaug.policy.enforce(context, _action, target) karbor.policy.enforce(context, _action, target)
class ProtectableViewBuilder(common.ViewBuilder): class ProtectableViewBuilder(common.ViewBuilder):
@ -124,7 +124,7 @@ class ProtectablesController(wsgi.Controller):
def show(self, req, id): def show(self, req, id):
"""Return data about the given protectable_type.""" """Return data about the given protectable_type."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
protectable_type = id protectable_type = id
LOG.info(_LI("Show the information of a given" LOG.info(_LI("Show the information of a given"
" protectable type: %s"), protectable_type) " protectable type: %s"), protectable_type)
@ -151,7 +151,7 @@ class ProtectablesController(wsgi.Controller):
transformed through view builder. transformed through view builder.
""" """
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show protectable type list"), context=context) LOG.info(_LI("Show protectable type list"), context=context)
protectable_types = self._get_all(context) protectable_types = self._get_all(context)
@ -173,7 +173,7 @@ class ProtectablesController(wsgi.Controller):
def instances_index(self, req, protectable_type): def instances_index(self, req, protectable_type):
"""Return data about the given protectable_type.""" """Return data about the given protectable_type."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show the instances of a given" LOG.info(_LI("Show the instances of a given"
" protectable type: %s"), protectable_type) " protectable type: %s"), protectable_type)
@ -252,7 +252,7 @@ class ProtectablesController(wsgi.Controller):
def instances_show(self, req, protectable_type, protectable_id): def instances_show(self, req, protectable_type, protectable_id):
"""Return a instance about the given protectable_type and id.""" """Return a instance about the given protectable_type and id."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show the instance of a given protectable" LOG.info(_LI("Show the instance of a given protectable"
" type: %s"), protectable_type) " type: %s"), protectable_type)

View File

@ -18,15 +18,15 @@ from oslo_utils import uuidutils
from webob import exc from webob import exc
from smaug.api import common from karbor.api import common
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import exception from karbor import exception
from smaug.i18n import _, _LI from karbor.i18n import _, _LI
from smaug import objects from karbor import objects
import smaug.policy import karbor.policy
from smaug.services.protection import api as protection_api from karbor.services.protection import api as protection_api
from smaug import utils from karbor import utils
import six import six
@ -59,7 +59,7 @@ def check_policy(context, action):
'user_id': context.user_id, 'user_id': context.user_id,
} }
_action = 'provider:%s' % action _action = 'provider:%s' % action
smaug.policy.enforce(context, _action, target) karbor.policy.enforce(context, _action, target)
class ProviderViewBuilder(common.ViewBuilder): class ProviderViewBuilder(common.ViewBuilder):
@ -183,7 +183,7 @@ class ProvidersController(wsgi.Controller):
def show(self, req, id): def show(self, req, id):
"""Return data about the given provider id.""" """Return data about the given provider id."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show provider with id: %s"), id) LOG.info(_LI("Show provider with id: %s"), id)
@ -198,7 +198,7 @@ class ProvidersController(wsgi.Controller):
def index(self, req): def index(self, req):
"""Returns a list of providers, transformed through view builder.""" """Returns a list of providers, transformed through view builder."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show provider list"), context=context) LOG.info(_LI("Show provider list"), context=context)
@ -275,7 +275,7 @@ class ProvidersController(wsgi.Controller):
try: try:
check_policy(context, 'get') check_policy(context, 'get')
except exception.PolicyNotAuthorized: except exception.PolicyNotAuthorized:
# raise ProviderNotFound instead to make sure smaug behaves # raise ProviderNotFound instead to make sure karbor behaves
# as it used to # as it used to
raise exception.ProviderNotFound(provider_id=provider_id) raise exception.ProviderNotFound(provider_id=provider_id)
@ -286,7 +286,7 @@ class ProvidersController(wsgi.Controller):
def checkpoints_index(self, req, provider_id): def checkpoints_index(self, req, provider_id):
"""Returns a list of checkpoints, transformed through view builder.""" """Returns a list of checkpoints, transformed through view builder."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show checkpoints list. " LOG.info(_LI("Show checkpoints list. "
"provider_id:%s"), provider_id) "provider_id:%s"), provider_id)
@ -350,7 +350,7 @@ class ProvidersController(wsgi.Controller):
if not self.is_valid_body(body, 'checkpoint'): if not self.is_valid_body(body, 'checkpoint'):
raise exc.HTTPUnprocessableEntity() raise exc.HTTPUnprocessableEntity()
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.debug('Create checkpoint request ' LOG.debug('Create checkpoint request '
'body: %s provider_id:%s', body, provider_id) 'body: %s provider_id:%s', body, provider_id)
@ -403,7 +403,7 @@ class ProvidersController(wsgi.Controller):
def checkpoints_show(self, req, provider_id, checkpoint_id): def checkpoints_show(self, req, provider_id, checkpoint_id):
"""Return data about the given checkpoint id.""" """Return data about the given checkpoint id."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show checkpoint with id: %s."), LOG.info(_LI("Show checkpoint with id: %s."),
checkpoint_id) checkpoint_id)
@ -433,7 +433,7 @@ class ProvidersController(wsgi.Controller):
try: try:
check_policy(context, 'checkpoint_get') check_policy(context, 'checkpoint_get')
except exception.PolicyNotAuthorized: except exception.PolicyNotAuthorized:
# raise CheckpointNotFound instead to make sure smaug behaves # raise CheckpointNotFound instead to make sure karbor behaves
# as it used to # as it used to
raise exception.CheckpointNotFound(checkpoint_id=checkpoint_id) raise exception.CheckpointNotFound(checkpoint_id=checkpoint_id)
@ -448,7 +448,7 @@ class ProvidersController(wsgi.Controller):
def checkpoints_delete(self, req, provider_id, checkpoint_id): def checkpoints_delete(self, req, provider_id, checkpoint_id):
"""Delete a checkpoint.""" """Delete a checkpoint."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Delete checkpoint with id: %s."), LOG.info(_LI("Delete checkpoint with id: %s."),
checkpoint_id) checkpoint_id)

View File

@ -18,17 +18,17 @@ from oslo_utils import uuidutils
from webob import exc from webob import exc
import smaug import karbor
from smaug.api import common from karbor.api import common
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import exception from karbor import exception
from smaug.i18n import _, _LI from karbor.i18n import _, _LI
from smaug import objects from karbor import objects
from smaug.objects import base as objects_base from karbor.objects import base as objects_base
import smaug.policy import karbor.policy
from smaug.services.protection import api as protection_api from karbor.services.protection import api as protection_api
from smaug import utils from karbor import utils
import six import six
@ -51,7 +51,7 @@ def check_policy(context, action, target_obj=None):
'user_id': context.user_id, 'user_id': context.user_id,
} }
if isinstance(target_obj, objects_base.SmaugObject): if isinstance(target_obj, objects_base.KarborObject):
# Turn object into dict so target.update can work # Turn object into dict so target.update can work
target.update( target.update(
target_obj.obj_to_primitive() or {}) target_obj.obj_to_primitive() or {})
@ -59,7 +59,7 @@ def check_policy(context, action, target_obj=None):
target.update(target_obj or {}) target.update(target_obj or {})
_action = 'restore:%s' % action _action = 'restore:%s' % action
smaug.policy.enforce(context, _action, target) karbor.policy.enforce(context, _action, target)
class RestoreViewBuilder(common.ViewBuilder): class RestoreViewBuilder(common.ViewBuilder):
@ -130,7 +130,7 @@ class RestoresController(wsgi.Controller):
def show(self, req, id): def show(self, req, id):
"""Return data about the given restore.""" """Return data about the given restore."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show restore with id: %s"), id, context=context) LOG.info(_LI("Show restore with id: %s"), id, context=context)
@ -149,7 +149,7 @@ class RestoresController(wsgi.Controller):
def index(self, req): def index(self, req):
"""Returns a list of restores, transformed through view builder.""" """Returns a list of restores, transformed through view builder."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
LOG.info(_LI("Show restore list"), context=context) LOG.info(_LI("Show restore list"), context=context)
@ -226,7 +226,7 @@ class RestoresController(wsgi.Controller):
raise exc.HTTPUnprocessableEntity() raise exc.HTTPUnprocessableEntity()
LOG.debug('Create restore request body: %s', body) LOG.debug('Create restore request body: %s', body)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
check_policy(context, 'create') check_policy(context, 'create')
restore = body['restore'] restore = body['restore']
LOG.debug('Create restore request : %s', restore) LOG.debug('Create restore request : %s', restore)
@ -290,7 +290,7 @@ class RestoresController(wsgi.Controller):
try: try:
check_policy(context, 'get', restore) check_policy(context, 'get', restore)
except exception.PolicyNotAuthorized: except exception.PolicyNotAuthorized:
# raise RestoreNotFound instead to make sure smaug behaves # raise RestoreNotFound instead to make sure karbor behaves
# as it used to # as it used to
raise exception.RestoreNotFound(restore_id=restore_id) raise exception.RestoreNotFound(restore_id=restore_id)
LOG.info(_LI("Restore info retrieved successfully.")) LOG.info(_LI("Restore info retrieved successfully."))
@ -302,13 +302,13 @@ class RestoresController(wsgi.Controller):
except exception.RestoreNotFound as error: except exception.RestoreNotFound as error:
raise exc.HTTPNotFound(explanation=error.msg) raise exc.HTTPNotFound(explanation=error.msg)
if isinstance(restore, objects_base.SmaugObject): if isinstance(restore, objects_base.KarborObject):
restore.update(fields) restore.update(fields)
restore.save() restore.save()
LOG.info(_LI("restore updated successfully.")) LOG.info(_LI("restore updated successfully."))
else: else:
msg = _("The parameter restore must be a object of " msg = _("The parameter restore must be a object of "
"SmaugObject class.") "KarborObject class.")
raise exception.InvalidInput(reason=msg) raise exception.InvalidInput(reason=msg)

View File

@ -10,14 +10,14 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from smaug.api.openstack import ProjectMapper from karbor.api.openstack import ProjectMapper
from smaug.api.v1 import plans from karbor.api.v1 import plans
from smaug.api.v1 import protectables from karbor.api.v1 import protectables
from smaug.api.v1 import providers from karbor.api.v1 import providers
from smaug.api.v1 import restores from karbor.api.v1 import restores
from smaug.api.v1 import scheduled_operations from karbor.api.v1 import scheduled_operations
from smaug.api.v1 import triggers from karbor.api.v1 import triggers
from smaug.wsgi import common as wsgi_common from karbor.wsgi import common as wsgi_common
class APIRouter(wsgi_common.Router): class APIRouter(wsgi_common.Router):

View File

@ -16,15 +16,15 @@ from oslo_log import log as logging
from oslo_utils import uuidutils from oslo_utils import uuidutils
from webob import exc from webob import exc
from smaug.api import common from karbor.api import common
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug import policy from karbor import policy
from smaug.services.operationengine import api as operationengine_api from karbor.services.operationengine import api as operationengine_api
from smaug.services.operationengine import operation_manager from karbor.services.operationengine import operation_manager
from smaug import utils from karbor import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -94,7 +94,7 @@ class ScheduledOperationController(wsgi.Controller):
raise exc.HTTPUnprocessableEntity() raise exc.HTTPUnprocessableEntity()
LOG.debug('Create a scheduled operation, request body: %s', body) LOG.debug('Create a scheduled operation, request body: %s', body)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
check_policy(context, 'create') check_policy(context, 'create')
operation_info = body['scheduled_operation'] operation_info = body['scheduled_operation']
@ -156,7 +156,7 @@ class ScheduledOperationController(wsgi.Controller):
LOG.debug('Delete scheduled operation(%s) start', id) LOG.debug('Delete scheduled operation(%s) start', id)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
operation = self._get_operation_by_id(context, id, ['trigger']) operation = self._get_operation_by_id(context, id, ['trigger'])
trigger = operation.trigger trigger = operation.trigger
@ -178,7 +178,7 @@ class ScheduledOperationController(wsgi.Controller):
LOG.debug('Get scheduled operation(%s) start', id) LOG.debug('Get scheduled operation(%s) start', id)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
operation = self._get_operation_by_id(context, id) operation = self._get_operation_by_id(context, id)
check_policy(context, 'get', operation) check_policy(context, 'get', operation)
@ -187,7 +187,7 @@ class ScheduledOperationController(wsgi.Controller):
def index(self, req): def index(self, req):
"""Returns a list of operations, transformed through view builder.""" """Returns a list of operations, transformed through view builder."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
check_policy(context, 'list') check_policy(context, 'list')
params = req.params.copy() params = req.params.copy()
@ -257,11 +257,11 @@ class ScheduledOperationController(wsgi.Controller):
def _raise_unknown_exception(self, exception_instance): def _raise_unknown_exception(self, exception_instance):
value = exception_instance.msg if isinstance( value = exception_instance.msg if isinstance(
exception_instance, exception.SmaugException) else type( exception_instance, exception.KarborException) else type(
exception_instance) exception_instance)
msg = (_('Unexpected API Error. Please report this at ' msg = (_('Unexpected API Error. Please report this at '
'http://bugs.launchpad.net/smaug/ and attach the ' 'http://bugs.launchpad.net/karbor/ and attach the '
'Smaug API log if possible.\n%s') % value) 'Karbor API log if possible.\n%s') % value)
raise exc.HTTPInternalServerError(explanation=msg) raise exc.HTTPInternalServerError(explanation=msg)

View File

@ -18,14 +18,14 @@ from oslo_utils import uuidutils
import uuid import uuid
from webob import exc from webob import exc
from smaug.api import common from karbor.api import common
from smaug.api.openstack import wsgi from karbor.api.openstack import wsgi
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug import policy from karbor import policy
from smaug.services.operationengine import api as operationengine_api from karbor.services.operationengine import api as operationengine_api
from smaug import utils from karbor import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -90,7 +90,7 @@ class TriggersController(wsgi.Controller):
raise exc.HTTPUnprocessableEntity() raise exc.HTTPUnprocessableEntity()
LOG.debug('Create a trigger, request body: %s', body) LOG.debug('Create a trigger, request body: %s', body)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
check_policy(context, 'create') check_policy(context, 'create')
trigger_info = body['trigger_info'] trigger_info = body['trigger_info']
@ -126,7 +126,7 @@ class TriggersController(wsgi.Controller):
LOG.debug('Delete trigger(%s) start', id) LOG.debug('Delete trigger(%s) start', id)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
trigger = self._get_trigger_by_id(context, id) trigger = self._get_trigger_by_id(context, id)
check_policy(context, 'delete', trigger) check_policy(context, 'delete', trigger)
@ -157,7 +157,7 @@ class TriggersController(wsgi.Controller):
LOG.debug('Update trigger(%s) start', id) LOG.debug('Update trigger(%s) start', id)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
trigger = self._get_trigger_by_id(context, id) trigger = self._get_trigger_by_id(context, id)
check_policy(context, 'update', trigger) check_policy(context, 'update', trigger)
@ -190,7 +190,7 @@ class TriggersController(wsgi.Controller):
LOG.debug('Get trigger(%s) start', id) LOG.debug('Get trigger(%s) start', id)
context = req.environ['smaug.context'] context = req.environ['karbor.context']
trigger = self._get_trigger_by_id(context, id) trigger = self._get_trigger_by_id(context, id)
check_policy(context, 'get', trigger) check_policy(context, 'get', trigger)
@ -199,7 +199,7 @@ class TriggersController(wsgi.Controller):
def index(self, req): def index(self, req):
"""Returns a list of triggers, transformed through view builder.""" """Returns a list of triggers, transformed through view builder."""
context = req.environ['smaug.context'] context = req.environ['karbor.context']
check_policy(context, 'list') check_policy(context, 'list')
params = req.params.copy() params = req.params.copy()
@ -240,11 +240,11 @@ class TriggersController(wsgi.Controller):
def _raise_unknown_exception(self, exception_instance): def _raise_unknown_exception(self, exception_instance):
value = exception_instance.msg if isinstance( value = exception_instance.msg if isinstance(
exception_instance, exception.SmaugException) else type( exception_instance, exception.KarborException) else type(
exception_instance) exception_instance)
msg = (_('Unexpected API Error. Please report this at ' msg = (_('Unexpected API Error. Please report this at '
'http://bugs.launchpad.net/smaug/ and attach the ' 'http://bugs.launchpad.net/karbor/ and attach the '
'Smaug API log if possible.\n%s') % value) 'Karbor API log if possible.\n%s') % value)
raise exc.HTTPInternalServerError(explanation=msg) raise exc.HTTPInternalServerError(explanation=msg)

View File

@ -11,11 +11,11 @@
# under the License. # under the License.
import httplib import httplib
from karbor.api.openstack import wsgi
from oslo_log import log as logging from oslo_log import log as logging
import webob.dec import webob.dec
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from smaug.api.openstack import wsgi
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""Starter script for smaug OS API.""" """Starter script for karbor OS API."""
import eventlet import eventlet
eventlet.monkey_patch() eventlet.monkey_patch()
@ -22,13 +22,13 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
# Need to register global_opts # Need to register global_opts
from smaug.common import config # noqa from karbor.common import config # noqa
from smaug import i18n from karbor import i18n
i18n.enable_lazy() i18n.enable_lazy()
from smaug import objects from karbor import objects
from smaug import rpc from karbor import rpc
from smaug import service from karbor import service
from smaug import version from karbor import version
CONF = cfg.CONF CONF = cfg.CONF
@ -36,12 +36,12 @@ CONF = cfg.CONF
def main(): def main():
objects.register_all() objects.register_all()
CONF(sys.argv[1:], project='smaug', CONF(sys.argv[1:], project='karbor',
version=version.version_string()) version=version.version_string())
logging.setup(CONF, "smaug") logging.setup(CONF, "karbor")
rpc.init(CONF) rpc.init(CONF)
launcher = service.process_launcher() launcher = service.process_launcher()
server = service.WSGIService('osapi_smaug') server = service.WSGIService('osapi_karbor')
launcher.launch_service(server, workers=server.workers) launcher.launch_service(server, workers=server.workers)
launcher.wait() launcher.wait()

View File

@ -12,7 +12,7 @@
# limitations under the License. # limitations under the License.
""" """
CLI interface for smaug management. CLI interface for karbor management.
""" """
from __future__ import print_function from __future__ import print_function
@ -25,19 +25,19 @@ from oslo_config import cfg
from oslo_db.sqlalchemy import migration from oslo_db.sqlalchemy import migration
from oslo_log import log as logging from oslo_log import log as logging
from smaug import i18n from karbor import i18n
i18n.enable_lazy() i18n.enable_lazy()
# Need to register global_opts # Need to register global_opts
from smaug.common import config # noqa from karbor.common import config # noqa
from smaug import context from karbor import context
from smaug import db from karbor import db
from smaug.db import migration as db_migration from karbor.db import migration as db_migration
from smaug.db.sqlalchemy import api as db_api from karbor.db.sqlalchemy import api as db_api
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug import utils from karbor import utils
from smaug import version from karbor import version
CONF = cfg.CONF CONF = cfg.CONF
@ -93,9 +93,9 @@ class ConfigCommands(object):
@args('param', nargs='?', default=None, @args('param', nargs='?', default=None,
help='Configuration parameter to display (default: %(default)s)') help='Configuration parameter to display (default: %(default)s)')
def list(self, param=None): def list(self, param=None):
"""List parameters configured for smaug. """List parameters configured for karbor.
Lists all parameters configured for smaug unless an optional argument Lists all parameters configured for karbor unless an optional argument
is specified. If the parameter is specified we only print the is specified. If the parameter is specified we only print the
requested parameter. If the parameter is not found an appropriate requested parameter. If the parameter is not found an appropriate
error is produced by .get*(). error is produced by .get*().
@ -111,7 +111,7 @@ class ConfigCommands(object):
class ServiceCommands(object): class ServiceCommands(object):
"""Methods for managing services.""" """Methods for managing services."""
def list(self): def list(self):
"""Show a list of all smaug services.""" """Show a list of all karbor services."""
ctxt = context.get_admin_context() ctxt = context.get_admin_context()
services = db.service_get_all(ctxt) services = db.service_get_all(ctxt)
@ -210,7 +210,7 @@ def main():
CONF.register_cli_opt(category_opt) CONF.register_cli_opt(category_opt)
script_name = sys.argv[0] script_name = sys.argv[0]
if len(sys.argv) < 2: if len(sys.argv) < 2:
print(_("\nOpenStack Smaug version: %(version)s\n") % print(_("\nOpenStack Karbor version: %(version)s\n") %
{'version': version.version_string()}) {'version': version.version_string()})
print(script_name + " category action [<args>]") print(script_name + " category action [<args>]")
print(_("Available categories:")) print(_("Available categories:"))
@ -219,9 +219,9 @@ def main():
sys.exit(2) sys.exit(2)
try: try:
CONF(sys.argv[1:], project='smaug', CONF(sys.argv[1:], project='karbor',
version=version.version_string()) version=version.version_string())
logging.setup(CONF, "smaug") logging.setup(CONF, "karbor")
except cfg.ConfigDirNotFoundError as details: except cfg.ConfigDirNotFoundError as details:
print(_("Invalid directory: %s") % details) print(_("Invalid directory: %s") % details)
sys.exit(2) sys.exit(2)
@ -237,7 +237,7 @@ def main():
except Exception: except Exception:
print(_('sudo failed, continuing as if nothing happened')) print(_('sudo failed, continuing as if nothing happened'))
print(_('Please re-run smaug-manage as root.')) print(_('Please re-run karbor-manage as root.'))
sys.exit(2) sys.exit(2)
fn = CONF.category.action_fn fn = CONF.category.action_fn

View File

@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Starter script for smaug OperationEngine.""" """Starter script for karbor OperationEngine."""
import eventlet import eventlet
eventlet.monkey_patch() eventlet.monkey_patch()
@ -21,14 +21,14 @@ import sys
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from smaug import i18n from karbor import i18n
i18n.enable_lazy() i18n.enable_lazy()
from smaug import objects from karbor import objects
# Need to register global_opts # Need to register global_opts
from smaug.common import config # noqa from karbor.common import config # noqa
from smaug import service from karbor import service
from smaug import version from karbor import version
CONF = cfg.CONF CONF = cfg.CONF
@ -36,9 +36,9 @@ CONF = cfg.CONF
def main(): def main():
objects.register_all() objects.register_all()
CONF(sys.argv[1:], project='smaug', CONF(sys.argv[1:], project='karbor',
version=version.version_string()) version=version.version_string())
logging.setup(CONF, "smaug") logging.setup(CONF, "karbor")
server = service.Service.create(binary='smaug-operationengine') server = service.Service.create(binary='karbor-operationengine')
service.serve(server) service.serve(server)
service.wait() service.wait()

View File

@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Starter script for smaug protection service.""" """Starter script for karbor protection service."""
import eventlet import eventlet
eventlet.monkey_patch() eventlet.monkey_patch()
@ -21,14 +21,14 @@ import sys
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from smaug import i18n from karbor import i18n
i18n.enable_lazy() i18n.enable_lazy()
from smaug import objects from karbor import objects
# Need to register global_opts # Need to register global_opts
from smaug.common import config # noqa from karbor.common import config # noqa
from smaug import service from karbor import service
from smaug import version from karbor import version
CONF = cfg.CONF CONF = cfg.CONF
@ -36,9 +36,9 @@ CONF = cfg.CONF
def main(): def main():
objects.register_all() objects.register_all()
CONF(sys.argv[1:], project='smaug', CONF(sys.argv[1:], project='karbor',
version=version.version_string()) version=version.version_string())
logging.setup(CONF, "smaug") logging.setup(CONF, "karbor")
server = service.Service.create(binary='smaug-protection') server = service.Service.create(binary='karbor-protection')
service.serve(server) service.serve(server)
service.wait() service.wait()

View File

@ -31,11 +31,11 @@ logging.register_options(CONF)
core_opts = [ core_opts = [
cfg.StrOpt('api_paste_config', cfg.StrOpt('api_paste_config',
default="api-paste.ini", default="api-paste.ini",
help='File name for the paste.deploy config for smaug-api'), help='File name for the paste.deploy config for karbor-api'),
cfg.StrOpt('state_path', cfg.StrOpt('state_path',
default='/var/lib/smaug', default='/var/lib/karbor',
deprecated_name='pybasedir', deprecated_name='pybasedir',
help="Top-level directory for maintaining smaug's state"), help="Top-level directory for maintaining karbor's state"),
] ]
debug_opts = [ debug_opts = [
@ -50,17 +50,17 @@ global_opts = [
help='Maximum time since last check-in for a service to be ' help='Maximum time since last check-in for a service to be '
'considered up'), 'considered up'),
cfg.StrOpt('operationengine_topic', cfg.StrOpt('operationengine_topic',
default='smaug-operationengine', default='karbor-operationengine',
help='The topic that OperationEngine nodes listen on'), help='The topic that OperationEngine nodes listen on'),
cfg.StrOpt('operationengine_manager', cfg.StrOpt('operationengine_manager',
default='smaug.services.operationengine.manager.' default='karbor.services.operationengine.manager.'
'OperationEngineManager', 'OperationEngineManager',
help='Full class name for the Manager for OperationEngine'), help='Full class name for the Manager for OperationEngine'),
cfg.StrOpt('protection_topic', cfg.StrOpt('protection_topic',
default='smaug-protection', default='karbor-protection',
help='The topic that protection nodes listen on'), help='The topic that protection nodes listen on'),
cfg.StrOpt('protection_manager', cfg.StrOpt('protection_manager',
default='smaug.services.protection.manager.ProtectionManager', default='karbor.services.protection.manager.ProtectionManager',
help='Full class name for the Manager for Protection'), help='Full class name for the Manager for Protection'),
cfg.StrOpt('host', cfg.StrOpt('host',
default=socket.gethostname(), default=socket.gethostname(),

View File

@ -18,9 +18,9 @@ from keystoneclient.v3 import client as kc_v3
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from smaug import exception from karbor import exception
from smaug.i18n import _LW from karbor.i18n import _LW
from smaug import utils from karbor import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -31,40 +31,40 @@ CONF = cfg.CONF
# [trustee] # [trustee]
# auth_type = password # auth_type = password
# auth_url = http://192.168.1.2:35357 # auth_url = http://192.168.1.2:35357
# username = smaug # username = karbor
# password = password # password = password
# user_domain_id = default # user_domain_id = default
TRUSTEE_CONF_GROUP = 'trustee' TRUSTEE_CONF_GROUP = 'trustee'
loading.register_auth_conf_options(CONF, TRUSTEE_CONF_GROUP) loading.register_auth_conf_options(CONF, TRUSTEE_CONF_GROUP)
class SmaugKeystonePlugin(object): class KarborKeystonePlugin(object):
"""Contruct a keystone client plugin with Smaug user """Contruct a keystone client plugin with karbor user
to offer the following functions: to offer the following functions:
1. get the endpoint of service, such as nova, cinder 1. get the endpoint of service, such as nova, cinder
2. create trust to smaug 2. create trust to karbor
""" """
def __init__(self): def __init__(self):
self._client = None self._client = None
self._auth_uri = "" self._auth_uri = ""
self._smaug_user_id = "" self._karbor_user_id = ""
self._do_init() self._do_init()
def _do_init(self): def _do_init(self):
auth_plugin = self._get_smaug_auth_plugin() auth_plugin = self._get_karbor_auth_plugin()
# set the project which smaug belongs to # set the project which karbor belongs to
auth_plugin._project_name = "service" auth_plugin._project_name = "service"
auth_plugin._project_domain_id = "default" auth_plugin._project_domain_id = "default"
self._client = self._get_keystone_client(auth_plugin) self._client = self._get_keystone_client(auth_plugin)
lcfg = CONF[TRUSTEE_CONF_GROUP] lcfg = CONF[TRUSTEE_CONF_GROUP]
self._smaug_user_id = self._get_service_user( self._karbor_user_id = self._get_service_user(
lcfg.username, lcfg.user_domain_id) lcfg.username, lcfg.user_domain_id)
try: try:
@ -93,7 +93,7 @@ class SmaugKeystonePlugin(object):
msg = ('get service(%s) endpoint failed' % service_name) msg = ('get service(%s) endpoint failed' % service_name)
raise exception.AuthorizationFailure(obj=msg) raise exception.AuthorizationFailure(obj=msg)
def create_trust_to_smaug(self, context): def create_trust_to_karbor(self, context):
if not context.auth_token_info: if not context.auth_token_info:
msg = ("user=%s, project=%s" % (context.user_id, msg = ("user=%s, project=%s" % (context.user_id,
context.project_id)) context.project_id))
@ -106,7 +106,7 @@ class SmaugKeystonePlugin(object):
l_kc_v3 = self._get_keystone_client(user_auth_plugin) l_kc_v3 = self._get_keystone_client(user_auth_plugin)
try: try:
trust = l_kc_v3.trusts.create(trustor_user=context.user_id, trust = l_kc_v3.trusts.create(trustor_user=context.user_id,
trustee_user=self._smaug_user_id, trustee_user=self._karbor_user_id,
project=context.project_id, project=context.project_id,
impersonation=True, impersonation=True,
role_names=context.roles) role_names=context.roles)
@ -115,13 +115,13 @@ class SmaugKeystonePlugin(object):
except Exception as e: except Exception as e:
raise exception.AuthorizationFailure(obj=str(e)) raise exception.AuthorizationFailure(obj=str(e))
def delete_trust_to_smaug(self, trust_id): def delete_trust_to_karbor(self, trust_id):
auth_plugin = self._get_smaug_auth_plugin(trust_id) auth_plugin = self._get_karbor_auth_plugin(trust_id)
client = self._get_keystone_client(auth_plugin) client = self._get_keystone_client(auth_plugin)
client.trusts.delete(trust_id) client.trusts.delete(trust_id)
def create_trust_session(self, trust_id): def create_trust_session(self, trust_id):
auth_plugin = self._get_smaug_auth_plugin(trust_id) auth_plugin = self._get_karbor_auth_plugin(trust_id)
return keystone_session.Session(auth=auth_plugin) return keystone_session.Session(auth=auth_plugin)
def _get_service_user(self, user_name, user_domain_id): def _get_service_user(self, user_name, user_domain_id):
@ -136,13 +136,13 @@ class SmaugKeystonePlugin(object):
msg = ("get service's user(%s) endpoint failed" % user_name) msg = ("get service's user(%s) endpoint failed" % user_name)
raise exception.AuthorizationFailure(obj=msg) raise exception.AuthorizationFailure(obj=msg)
def _get_smaug_auth_plugin(self, trust_id=None): def _get_karbor_auth_plugin(self, trust_id=None):
auth_plugin = loading.load_auth_from_conf_options( auth_plugin = loading.load_auth_from_conf_options(
CONF, TRUSTEE_CONF_GROUP, trust_id=trust_id) CONF, TRUSTEE_CONF_GROUP, trust_id=trust_id)
if not auth_plugin: if not auth_plugin:
LOG.warning(_LW('Please add the trustee credentials you ' LOG.warning(_LW('Please add the trustee credentials you '
'need to the %s section of your smaug.conf ' 'need to the %s section of your karbor.conf '
'file.') % TRUSTEE_CONF_GROUP) 'file.') % TRUSTEE_CONF_GROUP)
raise exception.AuthorizationFailure(obj=TRUSTEE_CONF_GROUP) raise exception.AuthorizationFailure(obj=TRUSTEE_CONF_GROUP)

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""RequestContext: context for requests that persist through all of smaug.""" """RequestContext: context for requests that persist through all of karbor."""
import copy import copy
@ -22,8 +22,8 @@ from oslo_log import log as logging
from oslo_utils import timeutils from oslo_utils import timeutils
import six import six
from smaug.i18n import _ from karbor.i18n import _
from smaug import policy from karbor import policy
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
""" """
DB abstraction for smaug DB abstraction for karbor
""" """
from smaug.db.api import * # noqa from karbor.db.api import * # noqa

View File

@ -12,8 +12,8 @@
"""Defines interface for DB access. """Defines interface for DB access.
Functions in this module are imported into the smaug.db namespace. Call these Functions in this module are imported into the karbor.db namespace. Call these
functions from smaug.db namespace, not the smaug.db.api namespace. functions from karbor.db namespace, not the karbor.db.api namespace.
All functions in this module return objects that implement a dictionary-like All functions in this module return objects that implement a dictionary-like
interface. Currently, many of these objects are sqlalchemy objects that interface. Currently, many of these objects are sqlalchemy objects that
@ -24,7 +24,7 @@ these objects be simple dictionaries.
**Related Flags** **Related Flags**
:connection: string specifying the sqlalchemy connection to use, like: :connection: string specifying the sqlalchemy connection to use, like:
`sqlite:///var/lib/smaug/smaug.sqlite`. `sqlite:///var/lib/karbor/karbor.sqlite`.
:enable_new_services: when adding a new service to the database, is it in the :enable_new_services: when adding a new service to the database, is it in the
pool of available hardware (Default: True) pool of available hardware (Default: True)
@ -46,9 +46,9 @@ db_opts = [
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(db_opts) CONF.register_opts(db_opts)
db_options.set_defaults(CONF) db_options.set_defaults(CONF)
CONF.set_default('sqlite_db', 'smaug.sqlite', group='database') CONF.set_default('sqlite_db', 'karbor.sqlite', group='database')
_BACKEND_MAPPING = {'sqlalchemy': 'smaug.db.sqlalchemy.api'} _BACKEND_MAPPING = {'sqlalchemy': 'karbor.db.sqlalchemy.api'}
IMPL = db_concurrency.TpoolDbapiWrapper(CONF, _BACKEND_MAPPING) IMPL = db_concurrency.TpoolDbapiWrapper(CONF, _BACKEND_MAPPING)

View File

@ -18,7 +18,7 @@ from oslo_utils import importutils
db_driver_opt = cfg.StrOpt('db_driver', db_driver_opt = cfg.StrOpt('db_driver',
default='smaug.db', default='karbor.db',
help='Driver to use for database access') help='Driver to use for database access')
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -19,7 +19,7 @@ from oslo_config import cfg
from oslo_db import options from oslo_db import options
from stevedore import driver from stevedore import driver
from smaug.db.sqlalchemy import api as db_api from karbor.db.sqlalchemy import api as db_api
INIT_VERSION = 000 INIT_VERSION = 000
@ -41,7 +41,7 @@ def get_backend():
with _LOCK: with _LOCK:
if _IMPL is None: if _IMPL is None:
_IMPL = driver.DriverManager( _IMPL = driver.DriverManager(
"smaug.database.migration_backend", "karbor.database.migration_backend",
cfg.CONF.database.backend).driver cfg.CONF.database.backend).driver
return _IMPL return _IMPL

View File

@ -35,15 +35,15 @@ from sqlalchemy.sql import expression
from sqlalchemy.sql.expression import literal_column from sqlalchemy.sql.expression import literal_column
from sqlalchemy.sql import func from sqlalchemy.sql import func
from smaug.db.sqlalchemy import models from karbor.db.sqlalchemy import models
from smaug import exception from karbor import exception
from smaug.i18n import _, _LW from karbor.i18n import _, _LW
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
options.set_defaults(CONF, connection='sqlite:///$state_path/smaug.sqlite') options.set_defaults(CONF, connection='sqlite:///$state_path/karbor.sqlite')
_LOCK = threading.Lock() _LOCK = threading.Lock()
_FACADE = None _FACADE = None
@ -1051,7 +1051,7 @@ def restore_destroy(context, restore_id):
def is_valid_model_filters(model, filters): def is_valid_model_filters(model, filters):
"""Return True if filter values exist on the model """Return True if filter values exist on the model
:param model: a smaug model :param model: a karbor model
:param filters: dictionary of filters :param filters: dictionary of filters
""" """
for key in filters.keys(): for key in filters.keys():

View File

@ -13,7 +13,7 @@
import os import os
from smaug.db.sqlalchemy import migrate_repo from karbor.db.sqlalchemy import migrate_repo
from migrate.versioning.shell import main from migrate.versioning.shell import main

View File

@ -1,7 +1,7 @@
[db_settings] [db_settings]
# Used to identify which repository this database is versioned under. # Used to identify which repository this database is versioned under.
# You can use the name of your project. # You can use the name of your project.
repository_id=smaug repository_id=karbor
# The name of the database table used to track the schema version. # The name of the database table used to track the schema version.
# This name shouldn't already be used by your project. # This name shouldn't already be used by your project.

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
""" """
SQLAlchemy models for smaug data. SQLAlchemy models for karbor data.
""" """
from oslo_config import cfg from oslo_config import cfg
@ -25,9 +25,9 @@ CONF = cfg.CONF
BASE = declarative_base() BASE = declarative_base()
class SmaugBase(models.TimestampMixin, class KarborBase(models.TimestampMixin,
models.ModelBase): models.ModelBase):
"""Base class for Smaug Models.""" """Base class for karbor Models."""
__table_args__ = {'mysql_engine': 'InnoDB'} __table_args__ = {'mysql_engine': 'InnoDB'}
@ -42,7 +42,7 @@ class SmaugBase(models.TimestampMixin,
self.save(session=session) self.save(session=session)
class Service(BASE, SmaugBase): class Service(BASE, KarborBase):
"""Represents a running service on a host.""" """Represents a running service on a host."""
__tablename__ = 'services' __tablename__ = 'services'
@ -54,7 +54,7 @@ class Service(BASE, SmaugBase):
disabled = Column(Boolean, default=False) disabled = Column(Boolean, default=False)
disabled_reason = Column(String(255)) disabled_reason = Column(String(255))
# adding column modified_at to contain timestamp # adding column modified_at to contain timestamp
# for manual enable/disable of smaug services # for manual enable/disable of karbor services
# updated_at column will now contain timestamps for # updated_at column will now contain timestamps for
# periodic updates # periodic updates
modified_at = Column(DateTime) modified_at = Column(DateTime)
@ -62,7 +62,7 @@ class Service(BASE, SmaugBase):
rpc_available_version = Column(String(36)) rpc_available_version = Column(String(36))
class Trigger(BASE, SmaugBase): class Trigger(BASE, KarborBase):
"""Represents a trigger.""" """Represents a trigger."""
__tablename__ = 'triggers' __tablename__ = 'triggers'
@ -74,7 +74,7 @@ class Trigger(BASE, SmaugBase):
properties = Column(Text, nullable=False) properties = Column(Text, nullable=False)
class ScheduledOperation(BASE, SmaugBase): class ScheduledOperation(BASE, KarborBase):
"""Represents a scheduled operation.""" """Represents a scheduled operation."""
__tablename__ = 'scheduled_operations' __tablename__ = 'scheduled_operations'
@ -98,7 +98,7 @@ class ScheduledOperation(BASE, SmaugBase):
'Trigger.deleted == 0)') 'Trigger.deleted == 0)')
class ScheduledOperationState(BASE, SmaugBase): class ScheduledOperationState(BASE, KarborBase):
"""Represents a scheduled operation state.""" """Represents a scheduled operation state."""
__tablename__ = 'scheduled_operation_states' __tablename__ = 'scheduled_operation_states'
@ -124,7 +124,7 @@ class ScheduledOperationState(BASE, SmaugBase):
'ScheduledOperation.deleted == 0)') 'ScheduledOperation.deleted == 0)')
class ScheduledOperationLog(BASE, SmaugBase): class ScheduledOperationLog(BASE, KarborBase):
"""Represents a scheduled operation log.""" """Represents a scheduled operation log."""
__tablename__ = 'scheduled_operation_logs' __tablename__ = 'scheduled_operation_logs'
@ -142,7 +142,7 @@ class ScheduledOperationLog(BASE, SmaugBase):
extend_info = Column(Text) extend_info = Column(Text)
class Plan(BASE, SmaugBase): class Plan(BASE, KarborBase):
"""Represents a Plan.""" """Represents a Plan."""
__tablename__ = 'plans' __tablename__ = 'plans'
@ -154,7 +154,7 @@ class Plan(BASE, SmaugBase):
parameters = Column(Text) parameters = Column(Text)
class Resource(BASE, SmaugBase): class Resource(BASE, KarborBase):
"""Represents a resource in a plan.""" """Represents a resource in a plan."""
__tablename__ = 'resources' __tablename__ = 'resources'
@ -170,7 +170,7 @@ class Resource(BASE, SmaugBase):
'Resource.deleted == False)') 'Resource.deleted == False)')
class Restore(BASE, SmaugBase): class Restore(BASE, KarborBase):
"""Represents a Restore.""" """Represents a Restore."""
__tablename__ = 'restores' __tablename__ = 'restores'
@ -183,7 +183,7 @@ class Restore(BASE, SmaugBase):
status = Column(String(64)) status = Column(String(64))
class OperationLog(BASE, SmaugBase): class OperationLog(BASE, KarborBase):
"""Represents a operation log.""" """Represents a operation log."""
__tablename__ = 'operation_logs' __tablename__ = 'operation_logs'
@ -200,7 +200,7 @@ class OperationLog(BASE, SmaugBase):
def register_models(): def register_models():
"""Register Models and create metadata. """Register Models and create metadata.
Called from smaug.db.sqlalchemy.__init__ as part of loading the driver, Called from karbor.db.sqlalchemy.__init__ as part of loading the driver,
it will never need to be called explicitly elsewhere unless the it will never need to be called explicitly elsewhere unless the
connection is lost and needs to be reestablished. connection is lost and needs to be reestablished.
""" """

View File

@ -10,9 +10,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Smaug base exception handling. """karbor base exception handling.
Includes decorator for re-raising Smaug-type exceptions. Includes decorator for re-raising karbor-type exceptions.
SHOULD include dedicated exception logging. SHOULD include dedicated exception logging.
@ -28,7 +28,7 @@ import webob.exc
from webob.util import status_generic_reasons from webob.util import status_generic_reasons
from webob.util import status_reasons from webob.util import status_reasons
from smaug.i18n import _, _LE from karbor.i18n import _, _LE
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -69,8 +69,8 @@ class Error(Exception):
pass pass
class SmaugException(Exception): class KarborException(Exception):
"""Base Smaug Exception """Base karbor Exception
To correctly use this class, inherit from it and define To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd a 'message' property. That message will get printf'd
@ -83,16 +83,16 @@ class SmaugException(Exception):
safe = False safe = False
def __init__(self, message=None, **kwargs): def __init__(self, message=None, **kwargs):
"""Initiate the instance of SmaugException """Initiate the instance of KarborException
There are two ways to initiate the instance. There are two ways to initiate the instance.
1. Specify the value of 'message' and leave the 'kwargs' None. 1. Specify the value of 'message' and leave the 'kwargs' None.
2. Leave 'message' None, and specify the keyword arguments matched 2. Leave 'message' None, and specify the keyword arguments matched
with the format of SmaugException.message. Especially, can't with the format of KarborException.message. Especially, can't
use the 'message' as the key in the 'kwargs', otherwise, the use the 'message' as the key in the 'kwargs', otherwise, the
first argument('message') will be set. first argument('message') will be set.
Note: This class doesn't support to create instance of SmaugException Note: This class doesn't support to create instance of KarborException
with another instance. with another instance.
""" """
self.kwargs = kwargs self.kwargs = kwargs
@ -126,13 +126,13 @@ class SmaugException(Exception):
# it, because if we try to access the message via 'message' it will be # it, because if we try to access the message via 'message' it will be
# overshadowed by the class' message attribute # overshadowed by the class' message attribute
self.msg = message self.msg = message
super(SmaugException, self).__init__(message) super(KarborException, self).__init__(message)
def __unicode__(self): def __unicode__(self):
return six.text_type(self.msg) return six.text_type(self.msg)
class NotAuthorized(SmaugException): class NotAuthorized(KarborException):
message = _("Not authorized.") message = _("Not authorized.")
code = 403 code = 403
@ -149,7 +149,7 @@ class AuthorizationFailure(NotAuthorized):
message = _("Authorization for %(obj)s is failed ") message = _("Authorization for %(obj)s is failed ")
class Invalid(SmaugException): class Invalid(KarborException):
message = _("Unacceptable parameters.") message = _("Unacceptable parameters.")
code = 400 code = 400
@ -162,7 +162,7 @@ class InvalidInput(Invalid):
message = _("Invalid input received: %(reason)s") message = _("Invalid input received: %(reason)s")
class NotFound(SmaugException): class NotFound(KarborException):
message = _("Resource could not be found.") message = _("Resource could not be found.")
code = 404 code = 404
safe = True safe = True
@ -172,7 +172,7 @@ class ConfigNotFound(NotFound):
message = _("Could not find config at %(path)s") message = _("Could not find config at %(path)s")
class MalformedRequestBody(SmaugException): class MalformedRequestBody(KarborException):
message = _("Malformed message body: %(reason)s") message = _("Malformed message body: %(reason)s")
@ -212,7 +212,7 @@ class ScheduledOperationLogNotFound(NotFound):
message = _("Scheduled Operation Log %(log_id)s could not be found.") message = _("Scheduled Operation Log %(log_id)s could not be found.")
class ListProtectableResourceFailed(SmaugException): class ListProtectableResourceFailed(KarborException):
message = _("List protectable resources of type %(type)s failed: " message = _("List protectable resources of type %(type)s failed: "
"%(reason)s") "%(reason)s")
@ -263,27 +263,27 @@ class ProviderNotFound(NotFound):
" not be found.") " not be found.")
class CreateBackupFailed(SmaugException): class CreateBackupFailed(KarborException):
message = _("Create Backup failed: %(reason)s, id=%(resource_id)s," message = _("Create Backup failed: %(reason)s, id=%(resource_id)s,"
" type=%(resource_type)s") " type=%(resource_type)s")
class DeleteBackupFailed(SmaugException): class DeleteBackupFailed(KarborException):
message = _("Delete Backup failed: %(reason)s, id=%(resource_id)s," message = _("Delete Backup failed: %(reason)s, id=%(resource_id)s,"
" type=%(resource_type)s") " type=%(resource_type)s")
class RestoreBackupFailed(SmaugException): class RestoreBackupFailed(KarborException):
message = _("Restore Backup failed: %(reason)s, id=%(resource_id)s," message = _("Restore Backup failed: %(reason)s, id=%(resource_id)s,"
" type=%(resource_type)s") " type=%(resource_type)s")
class GetBackupFailed(SmaugException): class GetBackupFailed(KarborException):
message = _("Get Backup failed: %(reason)s, id=%(resource_id)s," message = _("Get Backup failed: %(reason)s, id=%(resource_id)s,"
" type=%(resource_type)s") " type=%(resource_type)s")
class FlowError(SmaugException): class FlowError(KarborException):
message = _("Flow: %(flow)s, Error: %(error)s") message = _("Flow: %(flow)s, Error: %(error)s")
@ -292,35 +292,35 @@ class CheckpointNotFound(NotFound):
" not be found.") " not be found.")
class BankCreateObjectFailed(SmaugException): class BankCreateObjectFailed(KarborException):
message = _("Create Object in Bank Failed: %(reason)s") message = _("Create Object in Bank Failed: %(reason)s")
class BankUpdateObjectFailed(SmaugException): class BankUpdateObjectFailed(KarborException):
message = _("Update Object %(key)s in Bank Failed: %(reason)s") message = _("Update Object %(key)s in Bank Failed: %(reason)s")
class BankDeleteObjectFailed(SmaugException): class BankDeleteObjectFailed(KarborException):
message = _("Delete Object %(key)s in Bank Failed: %(reason)s") message = _("Delete Object %(key)s in Bank Failed: %(reason)s")
class BankGetObjectFailed(SmaugException): class BankGetObjectFailed(KarborException):
message = _("Get Object %(key)s in Bank Failed: %(reason)s") message = _("Get Object %(key)s in Bank Failed: %(reason)s")
class BankListObjectsFailed(SmaugException): class BankListObjectsFailed(KarborException):
message = _("Get Object in Bank Failed: %(reason)s") message = _("Get Object in Bank Failed: %(reason)s")
class BankReadonlyViolation(SmaugException): class BankReadonlyViolation(KarborException):
message = _("Bank read-only violation") message = _("Bank read-only violation")
class AcquireLeaseFailed(SmaugException): class AcquireLeaseFailed(KarborException):
message = _("Acquire Lease in Failed: %(reason)s") message = _("Acquire Lease in Failed: %(reason)s")
class CreateContainerFailed(SmaugException): class CreateContainerFailed(KarborException):
message = _("Create Container in Bank Failed: %(reason)s") message = _("Create Container in Bank Failed: %(reason)s")
@ -336,9 +336,9 @@ class InvalidOriginalId(Invalid):
message = _("The original_id: %(original_id)s is invalid.") message = _("The original_id: %(original_id)s is invalid.")
class CheckpointNotAvailable(SmaugException): class CheckpointNotAvailable(KarborException):
message = _("The checkpoint %(checkpoint_id)s is not available") message = _("The checkpoint %(checkpoint_id)s is not available")
class CheckpointNotBeDeleted(SmaugException): class CheckpointNotBeDeleted(KarborException):
message = _("The checkpoint %(checkpoint_id)s can not be deleted.") message = _("The checkpoint %(checkpoint_id)s can not be deleted.")

View File

@ -18,7 +18,7 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html .
import oslo_i18n as i18n import oslo_i18n as i18n
DOMAIN = 'smaug' DOMAIN = 'karbor'
_translators = i18n.TranslatorFactory(domain=DOMAIN) _translators = i18n.TranslatorFactory(domain=DOMAIN)

View File

@ -41,7 +41,7 @@ import sys
from oslo_utils import importutils from oslo_utils import importutils
from smaug import exception from karbor import exception
class BaseLoader(object): class BaseLoader(object):

View File

@ -44,8 +44,8 @@ from oslo_log import log as logging
import oslo_messaging as messaging import oslo_messaging as messaging
from oslo_service import periodic_task from oslo_service import periodic_task
from smaug.db import base from karbor.db import base
from smaug import version from karbor import version
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -15,11 +15,11 @@ def register_all():
# You must make sure your object gets imported in this # You must make sure your object gets imported in this
# function in order for it to be registered by services that may # function in order for it to be registered by services that may
# need to receive it via RPC. # need to receive it via RPC.
__import__('smaug.objects.service') __import__('karbor.objects.service')
__import__('smaug.objects.plan') __import__('karbor.objects.plan')
__import__('smaug.objects.scheduled_operation') __import__('karbor.objects.scheduled_operation')
__import__('smaug.objects.trigger') __import__('karbor.objects.trigger')
__import__('smaug.objects.scheduled_operation_log') __import__('karbor.objects.scheduled_operation_log')
__import__('smaug.objects.scheduled_operation_state') __import__('karbor.objects.scheduled_operation_state')
__import__('smaug.objects.restore') __import__('karbor.objects.restore')
__import__('smaug.objects.operation_log') __import__('karbor.objects.operation_log')

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Smaug common internal object model""" """karbor common internal object model"""
import contextlib import contextlib
import datetime import datetime
@ -19,11 +19,11 @@ from oslo_log import log as logging
from oslo_versionedobjects import base from oslo_versionedobjects import base
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug.db.sqlalchemy import models from karbor.db.sqlalchemy import models
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
LOG = logging.getLogger('object') LOG = logging.getLogger('object')
@ -32,7 +32,7 @@ remotable_classmethod = base.remotable_classmethod
obj_make_list = base.obj_make_list obj_make_list = base.obj_make_list
class SmaugObjectRegistry(base.VersionedObjectRegistry): class KarborObjectRegistry(base.VersionedObjectRegistry):
def registration_hook(self, cls, index): def registration_hook(self, cls, index):
setattr(objects, cls.obj_name(), cls) setattr(objects, cls.obj_name(), cls)
# For Versioned Object Classes that have a model store the model in # For Versioned Object Classes that have a model store the model in
@ -44,11 +44,11 @@ class SmaugObjectRegistry(base.VersionedObjectRegistry):
pass pass
class SmaugObject(base.VersionedObject): class KarborObject(base.VersionedObject):
OBJ_SERIAL_NAMESPACE = 'smaug_object' OBJ_SERIAL_NAMESPACE = 'karbor_object'
OBJ_PROJECT_NAMESPACE = 'smaug' OBJ_PROJECT_NAMESPACE = 'karbor'
def smaug_obj_get_changes(self): def karbor_obj_get_changes(self):
"""Returns a dict of changed fields with tz unaware datetimes. """Returns a dict of changed fields with tz unaware datetimes.
Any timezone aware datetime field will be converted to UTC timezone Any timezone aware datetime field will be converted to UTC timezone
@ -108,11 +108,11 @@ class SmaugObject(base.VersionedObject):
# We're using obj_extra_fields to provide aliases for some fields while # We're using obj_extra_fields to provide aliases for some fields while
# in transition period. This override is to make these aliases pass # in transition period. This override is to make these aliases pass
# "'foo' in obj" tests. # "'foo' in obj" tests.
return name in self.obj_extra_fields or super(SmaugObject, return name in self.obj_extra_fields or super(KarborObject,
self).__contains__(name) self).__contains__(name)
class SmaugObjectDictCompat(base.VersionedObjectDictCompat): class KarborObjectDictCompat(base.VersionedObjectDictCompat):
"""Mix-in to provide dictionary key access compat. """Mix-in to provide dictionary key access compat.
If an object needs to support attribute access using If an object needs to support attribute access using
@ -135,7 +135,7 @@ class SmaugObjectDictCompat(base.VersionedObjectDictCompat):
# The following preserves that compatibility but in # The following preserves that compatibility but in
# the future we'll remove this shim altogether so don't # the future we'll remove this shim altogether so don't
# rely on it. # rely on it.
LOG.debug('Smaug object %(object_name)s has no ' LOG.debug('Karbor object %(object_name)s has no '
'attribute named: %(attribute_name)s', 'attribute named: %(attribute_name)s',
{'object_name': self.__class__.__name__, {'object_name': self.__class__.__name__,
'attribute_name': key}) 'attribute_name': key})
@ -153,7 +153,7 @@ class SmaugObjectDictCompat(base.VersionedObjectDictCompat):
return None return None
class SmaugPersistentObject(object): class KarborPersistentObject(object):
"""Mixin class for Persistent objects. """Mixin class for Persistent objects.
This adds the fields that we use in common for all persistent objects. This adds the fields that we use in common for all persistent objects.
@ -188,7 +188,7 @@ class SmaugPersistentObject(object):
self._context = original_context self._context = original_context
class SmaugComparableObject(base.ComparableVersionedObject): class KarborComparableObject(base.ComparableVersionedObject):
def __eq__(self, obj): def __eq__(self, obj):
if hasattr(obj, 'obj_to_primitive'): if hasattr(obj, 'obj_to_primitive'):
return self.obj_to_primitive() == obj.obj_to_primitive() return self.obj_to_primitive() == obj.obj_to_primitive()
@ -199,8 +199,8 @@ class ObjectListBase(base.ObjectListBase):
pass pass
class SmaugObjectSerializer(base.VersionedObjectSerializer): class KarborObjectSerializer(base.VersionedObjectSerializer):
OBJ_BASE_CLASS = SmaugObject OBJ_BASE_CLASS = KarborObject
class DictOfDictOfStringsField(fields.AutoTypedField): class DictOfDictOfStringsField(fields.AutoTypedField):

View File

@ -14,20 +14,20 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class OperationLog(base.SmaugPersistentObject, base.SmaugObject, class OperationLog(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -61,13 +61,13 @@ class OperationLog(base.SmaugPersistentObject, base.SmaugObject,
if self.obj_attr_is_set('id'): if self.obj_attr_is_set('id'):
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
db_operation_log = db.operation_log_create(self._context, updates) db_operation_log = db.operation_log_create(self._context, updates)
self._from_db_object(self._context, self, db_operation_log) self._from_db_object(self._context, self, db_operation_log)
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates: if updates:
db.operation_log_update(self._context, self.id, updates) db.operation_log_update(self._context, self.id, updates)
self.obj_reset_changes() self.obj_reset_changes()
@ -78,8 +78,8 @@ class OperationLog(base.SmaugPersistentObject, base.SmaugObject,
db.operation_log_destroy(self._context, self.id) db.operation_log_destroy(self._context, self.id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class OperationLogList(base.ObjectListBase, base.SmaugObject): class OperationLogList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -15,20 +15,20 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class Plan(base.SmaugPersistentObject, base.SmaugObject, class Plan(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -107,7 +107,7 @@ class Plan(base.SmaugPersistentObject, base.SmaugObject,
if self.obj_attr_is_set('id'): if self.obj_attr_is_set('id'):
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
parameters = updates.pop('parameters', None) parameters = updates.pop('parameters', None)
if parameters is not None: if parameters is not None:
@ -121,7 +121,7 @@ class Plan(base.SmaugPersistentObject, base.SmaugObject,
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates: if updates:
if 'parameters' in updates: if 'parameters' in updates:
parameters = updates.pop('parameters', None) parameters = updates.pop('parameters', None)
@ -150,8 +150,8 @@ class Plan(base.SmaugPersistentObject, base.SmaugObject,
db.plan_destroy(self._context, self.id) db.plan_destroy(self._context, self.id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class PlanList(base.ObjectListBase, base.SmaugObject): class PlanList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -15,20 +15,20 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class Restore(base.SmaugPersistentObject, base.SmaugObject, class Restore(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -63,7 +63,7 @@ class Restore(base.SmaugPersistentObject, base.SmaugObject,
if self.obj_attr_is_set('id'): if self.obj_attr_is_set('id'):
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
parameters = updates.pop('parameters', None) parameters = updates.pop('parameters', None)
if parameters is not None: if parameters is not None:
@ -74,7 +74,7 @@ class Restore(base.SmaugPersistentObject, base.SmaugObject,
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates: if updates:
db.restore_update(self._context, self.id, updates) db.restore_update(self._context, self.id, updates)
self.obj_reset_changes() self.obj_reset_changes()
@ -85,8 +85,8 @@ class Restore(base.SmaugPersistentObject, base.SmaugObject,
db.restore_destroy(self._context, self.id) db.restore_destroy(self._context, self.id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class RestoreList(base.ObjectListBase, base.SmaugObject): class RestoreList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -15,20 +15,20 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ScheduledOperation(base.SmaugPersistentObject, base.SmaugObject, class ScheduledOperation(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -94,14 +94,14 @@ class ScheduledOperation(base.SmaugPersistentObject, base.SmaugObject,
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
self._convert_operation_definition_to_db_format(updates) self._convert_operation_definition_to_db_format(updates)
db_op = db.scheduled_operation_create(self._context, updates) db_op = db.scheduled_operation_create(self._context, updates)
self._from_db_object(self._context, self, db_op) self._from_db_object(self._context, self, db_op)
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates and self.id: if updates and self.id:
db.scheduled_operation_update(self._context, db.scheduled_operation_update(self._context,
self.id, self.id,
@ -114,8 +114,8 @@ class ScheduledOperation(base.SmaugPersistentObject, base.SmaugObject,
db.scheduled_operation_delete(self._context, self.id) db.scheduled_operation_delete(self._context, self.id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ScheduledOperationList(base.ObjectListBase, base.SmaugObject): class ScheduledOperationList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -14,19 +14,19 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ScheduledOperationLog(base.SmaugPersistentObject, base.SmaugObject, class ScheduledOperationLog(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -62,13 +62,13 @@ class ScheduledOperationLog(base.SmaugPersistentObject, base.SmaugObject,
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
db_log = db.scheduled_operation_log_create(self._context, updates) db_log = db.scheduled_operation_log_create(self._context, updates)
self._from_db_object(self._context, self, db_log) self._from_db_object(self._context, self, db_log)
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates and self.id is not None: if updates and self.id is not None:
db.scheduled_operation_log_update(self._context, self.id, updates) db.scheduled_operation_log_update(self._context, self.id, updates)
self.obj_reset_changes() self.obj_reset_changes()
@ -85,8 +85,8 @@ class ScheduledOperationLog(base.SmaugPersistentObject, base.SmaugObject,
context, operation_id, retained_num, excepted_states) context, operation_id, retained_num, excepted_states)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ScheduledOperationLogList(base.ObjectListBase, base.SmaugObject): class ScheduledOperationLogList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -14,20 +14,20 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ScheduledOperationState(base.SmaugPersistentObject, base.SmaugObject, class ScheduledOperationState(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -81,13 +81,13 @@ class ScheduledOperationState(base.SmaugPersistentObject, base.SmaugObject,
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
db_state = db.scheduled_operation_state_create(self._context, updates) db_state = db.scheduled_operation_state_create(self._context, updates)
self._from_db_object(self._context, self, db_state) self._from_db_object(self._context, self, db_state)
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates and self.operation_id: if updates and self.operation_id:
db.scheduled_operation_state_update(self._context, db.scheduled_operation_state_update(self._context,
self.operation_id, self.operation_id,
@ -101,8 +101,8 @@ class ScheduledOperationState(base.SmaugPersistentObject, base.SmaugObject,
self.operation_id) self.operation_id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ScheduledOperationStateList(base.ObjectListBase, base.SmaugObject): class ScheduledOperationStateList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -14,20 +14,20 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug import objects from karbor import objects
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class Service(base.SmaugPersistentObject, base.SmaugObject, class Service(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -73,13 +73,13 @@ class Service(base.SmaugPersistentObject, base.SmaugObject,
if self.obj_attr_is_set('id'): if self.obj_attr_is_set('id'):
raise exception.ObjectActionError(action='create', raise exception.ObjectActionError(action='create',
reason=_('already created')) reason=_('already created'))
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
db_service = db.service_create(self._context, updates) db_service = db.service_create(self._context, updates)
self._from_db_object(self._context, self, db_service) self._from_db_object(self._context, self, db_service)
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates: if updates:
db.service_update(self._context, self.id, updates) db.service_update(self._context, self.id, updates)
self.obj_reset_changes() self.obj_reset_changes()
@ -90,8 +90,8 @@ class Service(base.SmaugPersistentObject, base.SmaugObject,
db.service_destroy(self._context, self.id) db.service_destroy(self._context, self.id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class ServiceList(base.ObjectListBase, base.SmaugObject): class ServiceList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -15,17 +15,17 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from smaug import db from karbor import db
from smaug.objects import base from karbor.objects import base
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class Trigger(base.SmaugPersistentObject, base.SmaugObject, class Trigger(base.KarborPersistentObject, base.KarborObject,
base.SmaugObjectDictCompat, base.KarborObjectDictCompat,
base.SmaugComparableObject): base.KarborComparableObject):
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' VERSION = '1.0'
@ -67,14 +67,14 @@ class Trigger(base.SmaugPersistentObject, base.SmaugObject,
@base.remotable @base.remotable
def create(self): def create(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
self._convert_properties_to_db_format(updates) self._convert_properties_to_db_format(updates)
db_trigger = db.trigger_create(self._context, updates) db_trigger = db.trigger_create(self._context, updates)
self._from_db_object(self._context, self, db_trigger) self._from_db_object(self._context, self, db_trigger)
@base.remotable @base.remotable
def save(self): def save(self):
updates = self.smaug_obj_get_changes() updates = self.karbor_obj_get_changes()
if updates and self.id: if updates and self.id:
self._convert_properties_to_db_format(updates) self._convert_properties_to_db_format(updates)
db.trigger_update(self._context, self.id, updates) db.trigger_update(self._context, self.id, updates)
@ -86,8 +86,8 @@ class Trigger(base.SmaugPersistentObject, base.SmaugObject,
db.trigger_delete(self._context, self.id) db.trigger_delete(self._context, self.id)
@base.SmaugObjectRegistry.register @base.KarborObjectRegistry.register
class TriggerList(base.ObjectListBase, base.SmaugObject): class TriggerList(base.ObjectListBase, base.KarborObject):
VERSION = '1.0' VERSION = '1.0'
fields = { fields = {

View File

@ -13,14 +13,14 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Policy Engine For Smaug""" """Policy Engine For karbor"""
from oslo_config import cfg from oslo_config import cfg
from oslo_policy import opts as policy_opts from oslo_policy import opts as policy_opts
from oslo_policy import policy from oslo_policy import policy
from smaug import exception from karbor import exception
CONF = cfg.CONF CONF = cfg.CONF
policy_opts.set_defaults(cfg.CONF, 'policy.json') policy_opts.set_defaults(cfg.CONF, 'policy.json')
@ -48,7 +48,7 @@ def enforce_action(context, action):
def enforce(context, action, target): def enforce(context, action, target):
"""Verifies that the action is valid on the target in this context. """Verifies that the action is valid on the target in this context.
:param context: smaug context :param context: karbor context
:param action: string representing the action to be checked :param action: string representing the action to be checked
this should be colon separated for clarity. this should be colon separated for clarity.
i.e. ``compute:create_instance``, i.e. ``compute:create_instance``,

View File

@ -27,15 +27,15 @@ from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import smaug.context import karbor.context
import smaug.exception import karbor.exception
CONF = cfg.CONF CONF = cfg.CONF
TRANSPORT = None TRANSPORT = None
NOTIFIER = None NOTIFIER = None
ALLOWED_EXMODS = [ ALLOWED_EXMODS = [
smaug.exception.__name__, karbor.exception.__name__,
] ]
EXTRA_EXMODS = [] EXTRA_EXMODS = []
@ -107,7 +107,7 @@ class RequestContextSerializer(messaging.Serializer):
return _context return _context
def deserialize_context(self, context): def deserialize_context(self, context):
return smaug.context.RequestContext.from_dict(context) return karbor.context.RequestContext.from_dict(context)
def get_client(target, version_cap=None, serializer=None): def get_client(target, version_cap=None, serializer=None):

View File

@ -26,15 +26,15 @@ from oslo_service import loopingcall
from oslo_service import service from oslo_service import service
from oslo_utils import importutils from oslo_utils import importutils
from smaug import context from karbor import context
from smaug import db from karbor import db
from smaug import exception from karbor import exception
from smaug.i18n import _, _LE, _LI, _LW from karbor.i18n import _, _LE, _LI, _LW
from smaug.objects import base as objects_base from karbor.objects import base as objects_base
from smaug import rpc from karbor import rpc
from smaug import version from karbor import version
from smaug.wsgi import common as wsgi_common from karbor.wsgi import common as wsgi_common
from smaug.wsgi import eventlet_server as wsgi from karbor.wsgi import eventlet_server as wsgi
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -51,14 +51,14 @@ service_opts = [
help='Range, in seconds, to randomly delay when starting the' help='Range, in seconds, to randomly delay when starting the'
' periodic task OperationEngine to reduce stampeding.' ' periodic task OperationEngine to reduce stampeding.'
' (Disable by setting to 0)'), ' (Disable by setting to 0)'),
cfg.StrOpt('osapi_smaug_listen', cfg.StrOpt('osapi_karbor_listen',
default="0.0.0.0", default="0.0.0.0",
help='IP address on which OpenStack Smaug API listens'), help='IP address on which OpenStack Karbor API listens'),
cfg.PortOpt('osapi_smaug_listen_port', cfg.PortOpt('osapi_karbor_listen_port',
default=8799, default=8799,
help='Port on which OpenStack Smaug API listens'), help='Port on which OpenStack Karbor API listens'),
cfg.IntOpt('osapi_smaug_workers', cfg.IntOpt('osapi_karbor_workers',
help='Number of workers for OpenStack Smaug API service. ' help='Number of workers for OpenStack Karbor API service. '
'The default is equal to the number of CPUs available.'), ] 'The default is equal to the number of CPUs available.'), ]
CONF = cfg.CONF CONF = cfg.CONF
@ -118,7 +118,7 @@ class Service(service.Service):
target = messaging.Target(topic=self.topic, server=self.host) target = messaging.Target(topic=self.topic, server=self.host)
endpoints = [self.manager] endpoints = [self.manager]
endpoints.extend(self.manager.additional_endpoints) endpoints.extend(self.manager.additional_endpoints)
serializer = objects_base.SmaugObjectSerializer() serializer = objects_base.KarborObjectSerializer()
self.rpcserver = rpc.get_server(target, endpoints, serializer) self.rpcserver = rpc.get_server(target, endpoints, serializer)
self.rpcserver.start() self.rpcserver.start()
@ -180,7 +180,7 @@ class Service(service.Service):
:param host: defaults to CONF.host :param host: defaults to CONF.host
:param binary: defaults to basename of executable :param binary: defaults to basename of executable
:param topic: defaults to bin_name - 'smaug-' part :param topic: defaults to bin_name - 'karbor-' part
:param manager: defaults to CONF.<topic>_manager :param manager: defaults to CONF.<topic>_manager
:param report_interval: defaults to CONF.report_interval :param report_interval: defaults to CONF.report_interval
:param periodic_interval: defaults to CONF.periodic_interval :param periodic_interval: defaults to CONF.periodic_interval
@ -194,7 +194,7 @@ class Service(service.Service):
if not topic: if not topic:
topic = binary topic = binary
if not manager: if not manager:
subtopic = topic.rpartition('smaug-')[2] subtopic = topic.rpartition('karbor-')[2]
manager = CONF.get('%s_manager' % subtopic, None) manager = CONF.get('%s_manager' % subtopic, None)
if report_interval is None: if report_interval is None:
report_interval = CONF.report_interval report_interval = CONF.report_interval

View File

@ -16,8 +16,8 @@
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from smaug.db import base from karbor.db import base
from smaug.services.operationengine import rpcapi as operationengine_rpcapi from karbor.services.operationengine import rpcapi as operationengine_rpcapi
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -19,12 +19,12 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import timeutils from oslo_utils import timeutils
from smaug.common import constants from karbor.common import constants
from smaug import context from karbor import context
from smaug.i18n import _LE, _LW from karbor.i18n import _LE, _LW
from smaug import objects from karbor import objects
from smaug.services.operationengine.engine.executors import base from karbor.services.operationengine.engine.executors import base
from smaug.services.operationengine import operation_manager from karbor.services.operationengine import operation_manager
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -16,8 +16,8 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from threading import RLock from threading import RLock
from smaug.i18n import _LE from karbor.i18n import _LE
from smaug.services.operationengine.engine.executors import\ from karbor.services.operationengine.engine.executors import\
scheduled_operation_executor as base_executor scheduled_operation_executor as base_executor
executor_opts = [ executor_opts = [

View File

@ -15,9 +15,9 @@ Manage all triggers.
""" """
from stevedore import driver as import_driver from stevedore import driver as import_driver
from smaug import exception from karbor import exception
from smaug.i18n import _ from karbor.i18n import _
from smaug.services.operationengine.engine import triggers as all_triggers from karbor.services.operationengine.engine import triggers as all_triggers
class TriggerManager(object): class TriggerManager(object):
@ -36,7 +36,7 @@ class TriggerManager(object):
self._trigger_obj_map = {} self._trigger_obj_map = {}
executor_cls = import_driver.DriverManager( executor_cls = import_driver.DriverManager(
'smaug.operationengine.engine.executor', 'karbor.operationengine.engine.executor',
'executor').driver 'executor').driver
self._executor = executor_cls() self._executor = executor_cls()

Some files were not shown because too many files have changed in this diff Show More