Change Smaug to Karbor
There was a decision in the community to change the project name. Change-Id: I8b3d538b9573ebaa2a873f4696e1f1a500c941a8
|
@ -1,7 +1,7 @@
|
|||
[run]
|
||||
branch = True
|
||||
source = smaug
|
||||
omit = smaug/tests/*,smaug/openstack/*
|
||||
source = karbor
|
||||
omit = karbor/tests/*,karbor/openstack/*
|
||||
|
||||
[report]
|
||||
ignore_errors = True
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gerrit]
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack/smaug.git
|
||||
project=openstack/karbor.git
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||
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_list_option=--list
|
||||
|
|
|
@ -14,4 +14,4 @@ Pull requests submitted through GitHub will be ignored.
|
|||
|
||||
Bugs should be filed on Launchpad, not GitHub:
|
||||
|
||||
https://bugs.launchpad.net/smaug
|
||||
https://bugs.launchpad.net/karbor
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
smaug Style Commandments
|
||||
karbor Style Commandments
|
||||
===============================================
|
||||
|
||||
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include AUTHORS
|
||||
include ChangeLog
|
||||
recursive-include smaug *.cfg
|
||||
recursive-include karbor *.cfg
|
||||
|
||||
exclude .gitignore
|
||||
exclude .gitreview
|
||||
|
|
16
README.rst
|
@ -1,11 +1,11 @@
|
|||
=====
|
||||
Smaug
|
||||
Karbor
|
||||
=====
|
||||
|
||||
Application Data Protection as a Service for OpenStack
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/Smaug.png
|
||||
:alt: Smaug
|
||||
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/Karbor.png
|
||||
:alt: Karbor
|
||||
:width: 300
|
||||
:height: 525
|
||||
:align: center
|
||||
|
@ -45,12 +45,12 @@ Links
|
|||
*****
|
||||
|
||||
* Free software: Apache license
|
||||
* Documentation: http://docs.openstack.org/developer/smaug
|
||||
* Source: http://git.openstack.org/cgit/openstack/smaug
|
||||
* Bugs: http://bugs.launchpad.net/smaug
|
||||
* Documentation: http://docs.openstack.org/developer/karbor
|
||||
* Source: http://git.openstack.org/cgit/openstack/karbor
|
||||
* Bugs: http://bugs.launchpad.net/karbor
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/SmaugInPieces.png
|
||||
:alt: Smaug
|
||||
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/KarborInPieces.png
|
||||
:alt: Karbor
|
||||
:width: 200
|
||||
:height: 525
|
||||
:align: center
|
||||
|
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
@ -9,10 +9,10 @@
|
|||
</filter>
|
||||
</defs>
|
||||
<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;" />
|
||||
<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="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" />
|
||||
|
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
@ -9,7 +9,7 @@
|
|||
</filter>
|
||||
</defs>
|
||||
<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" />
|
||||
<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 "
|
||||
|
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
|
@ -1,4 +1,4 @@
|
|||
# Smaug API #
|
||||
# Karbor API #
|
||||
|
||||
----------
|
||||
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
*** :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
|
||||
metdata but there might be issues when using default plugins.
|
||||
|
||||
## 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
|
||||
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
|
||||
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.
|
||||
|
@ -80,7 +80,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
|
|||
* buffer:
|
||||
```json
|
||||
{
|
||||
"smaug_version": "1.0.0",
|
||||
"karbor_version": "1.0.0",
|
||||
"status": "in_progress",
|
||||
"plugins": {}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
|
|||
* buffer:
|
||||
```json
|
||||
{
|
||||
"smaug_version": "1.0.0",
|
||||
"karbor_version": "1.0.0",
|
||||
"status": "creating_indices",
|
||||
"plugins": {}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ Create new Checkpoint with id <CHECKPOINT-ID>;
|
|||
* buffer:
|
||||
```json
|
||||
{
|
||||
"smaug_version": "1.0.0",
|
||||
"karbor_version": "1.0.0",
|
||||
"status": "deleting",
|
||||
"plugins": {}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ or returned by the provider.
|
|||
## GC
|
||||
|
||||
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
|
||||
the deletion has been propagated to all sites before actually deleting the data.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@startuml
|
||||
|
||||
title "Smaug API model"
|
||||
title "Karbor API model"
|
||||
|
||||
class Protectable {
|
||||
name: string
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
swagger: '2.0'
|
||||
info:
|
||||
title: Smaug API
|
||||
title: Karbor API
|
||||
description: Protect all you hold dear
|
||||
version: 0.99.0
|
||||
host: api.smaug.nowhere.com
|
||||
host: api.karbor.nowhere.com
|
||||
schemes:
|
||||
- https
|
||||
basePath: /v1
|
||||
|
@ -729,7 +729,7 @@ paths:
|
|||
get:
|
||||
summary: Operation log entry point.
|
||||
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.
|
||||
The user never creates operation logs.
|
||||
This should not include the 'entires' property for the operation log.
|
|
@ -38,7 +38,7 @@ source_suffix = '.rst'
|
|||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'smaug'
|
||||
project = u'karbor'
|
||||
copyright = u'2013, OpenStack Foundation'
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
==================================
|
||||
Smaug: Application Data Protection
|
||||
Karbor: Application Data Protection
|
||||
==================================
|
||||
|
||||
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
|
||||
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
|
||||
through a unified interface
|
||||
|
||||
Using Smaug
|
||||
Using Karbor
|
||||
===========
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
@ -26,7 +26,7 @@ Using Smaug
|
|||
contributing
|
||||
releasenotes
|
||||
|
||||
Smaug Specs
|
||||
Karbor Specs
|
||||
===========
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
|
|
@ -4,18 +4,18 @@ 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]]:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
enable_plugin smaug http://git.openstack.org/openstack/smaug master
|
||||
enable_plugin smaug-dashboard http://git.openstack.org/openstack/smaug-dashboard master
|
||||
enable_service smaug-api
|
||||
enable_service smaug-operationengine
|
||||
enable_service smaug-protection
|
||||
# Smaug Dashboard depends on Horizon
|
||||
enable_service smaug-dashboard
|
||||
enable_plugin karbor http://git.openstack.org/openstack/karbor master
|
||||
enable_plugin karbor-dashboard http://git.openstack.org/openstack/karbor-dashboard master
|
||||
enable_service karbor-api
|
||||
enable_service karbor-operationengine
|
||||
enable_service karbor-protection
|
||||
# Karbor Dashboard depends on Horizon
|
||||
enable_service karbor-dashboard
|
||||
|
||||
Depenencies
|
||||
===========
|
||||
|
|
|
@ -5,15 +5,15 @@ Introduction
|
|||
|
||||
.. 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
|
||||
application - Application Data Protection as a Service.
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/Smaug.png
|
||||
:alt: Smaug
|
||||
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/Karbor.png
|
||||
:alt: Karbor
|
||||
:align: center
|
||||
:height: 150px
|
||||
|
||||
|
@ -33,7 +33,7 @@ Typical Use Case: 3-Tier Cloud App
|
|||
|
||||
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
|
||||
:width: 600
|
||||
: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
|
||||
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
|
||||
:width: 600
|
||||
:align: center
|
||||
|
||||
These resources can be divided into groups, each of which will be handled by a
|
||||
different plugin in Smaug:
|
||||
different plugin in Karbor:
|
||||
|
||||
- Volume
|
||||
- VM
|
||||
|
@ -62,7 +62,7 @@ Main Concepts
|
|||
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
|
||||
: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
|
||||
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.
|
||||
|
||||
Example
|
||||
|
@ -112,12 +112,12 @@ provider.
|
|||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
------------
|
||||
Protectabes are any class or type of entity that can be protected by Smaug.
|
||||
Since setups might have different entities they would like to protect 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 Karbor
|
||||
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
|
||||
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.
|
||||
|
||||
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
|
||||
:alt: Solution Overview
|
||||
:width: 600
|
||||
|
@ -157,15 +157,15 @@ High Level Architecture
|
|||
The system is built from independent services and a scalable *Workflow
|
||||
engine* that ties them together:
|
||||
|
||||
Smaug API Service
|
||||
Karbor API Service
|
||||
=================
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/openstack/smaug/master/doc/images/
|
||||
smaug-api.png
|
||||
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/
|
||||
karbor-api.png
|
||||
:width: 600
|
||||
|
||||
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
|
||||
(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
|
||||
---------------------------
|
||||
|
||||
Enables the Smaug user to access information about which resource types are
|
||||
protectable (i.e. can be protected by Smaug). In addition, enables the user to
|
||||
Enables the Karbor user to access information about which resource types are
|
||||
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
|
||||
instances and their dependencies.
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
|
||||
- Plan CRUD.
|
||||
|
@ -201,7 +201,7 @@ the following operations:
|
|||
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.
|
||||
- Delete unneeded checkpoints from the provider.
|
||||
|
@ -210,7 +210,7 @@ This API enables the Smaug user to manage protection Operations:
|
|||
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:
|
||||
|
||||
- List all checkpoints given a Bank ID.
|
||||
|
@ -221,11 +221,11 @@ the protection provider:
|
|||
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.
|
||||
|
||||
Smaug Schedule Service
|
||||
Karbor Schedule Service
|
||||
======================
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Scheduled Operation
|
||||
|
@ -265,7 +265,7 @@ Scheduled Operation
|
|||
The sub-component of the Schedule Service is responsible for holding the
|
||||
mapping between a Trigger and Operation(s).
|
||||
|
||||
Smaug Protection Service
|
||||
Karbor Protection Service
|
||||
========================
|
||||
|
||||
This subsystem is responsible for handling the following tasks:
|
||||
|
@ -282,20 +282,20 @@ flow of the plan across all protection providers.
|
|||
Communication and Meetings
|
||||
==========================
|
||||
|
||||
- Smaug Launchpad Link: \ https://launchpad.net/smaug
|
||||
- Smaug Code Review: \ https://review.openstack.org/#/q/smaug+status:open,n,z
|
||||
- Smaug Code Repository: \ https://github.com/openstack/smaug
|
||||
- Smaug daily IRC Channel: #openstack-smaug
|
||||
- Smaug weekly IRC Meeting on **even** Tuesday at 1500 UTC
|
||||
- Karbor Launchpad Link: \ https://launchpad.net/karbor
|
||||
- Karbor Code Review: \ https://review.openstack.org/#/q/karbor+status:open,n,z
|
||||
- Karbor Code Repository: \ https://github.com/openstack/karbor
|
||||
- Karbor daily IRC Channel: #openstack-karbor
|
||||
- Karbor weekly IRC Meeting on **even** Tuesday at 1500 UTC
|
||||
and on **odd** Tuesday at 0900 UTC in
|
||||
#openstack-meeting at freenode: \
|
||||
https://wiki.openstack.org/wiki/Meetings/smaug
|
||||
- Smaug Trello Board: \ https://trello.com/b/Sudr4fKT/smaug
|
||||
https://wiki.openstack.org/wiki/Meetings/karbor
|
||||
- Karbor Trello Board: \ https://trello.com/b/Sudr4fKT/karbor
|
||||
|
||||
Additional references
|
||||
=====================
|
||||
|
||||
- `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>`_
|
||||
- `Smaug 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 slide <https://docs.google.com/presentation/d/1JYO1VIlTkGTF6lvKEMcsHkaST3mYFxuarpcNTJ3HBhk/edit?usp=sharing>`_
|
||||
- `Karbor overview blog <http://blog.gampel.net/2015/12/karbor-application-data-protection-for.html>`_
|
||||
|
|
|
@ -10,7 +10,7 @@ API Service
|
|||
|
||||
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
|
||||
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
|
||||
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
|
||||
resources 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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
Protectable Controller
|
||||
---------------------------
|
||||
|
||||
Enables the Smaug user to access information about which resource types
|
||||
are protectable (i.e. can be protected by Smaug).
|
||||
Enables the Karbor user to access information about which resource types
|
||||
are 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 instances and their dependencies.
|
||||
|
||||
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:
|
||||
- Plan CRUD.
|
||||
- List Plans.
|
||||
|
@ -65,7 +65,7 @@ and do the following operations:
|
|||
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.
|
||||
- List Operations.
|
||||
|
@ -73,7 +73,7 @@ This API enables the Smaug user to manage Scheduled Operations:
|
|||
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
|
||||
scheduled operation.
|
||||
- Trigger CRUD.
|
||||
|
@ -83,7 +83,7 @@ scheduled operation.
|
|||
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.
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
@startuml
|
||||
|
||||
title Smaug Protectables
|
||||
title Karbor Protectables
|
||||
|
||||
hide circle
|
||||
|
||||
legend top
|
||||
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
|
||||
responsible for the connection.
|
||||
endlegend
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
=================
|
||||
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.
|
||||
|
||||
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
|
||||
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:
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Smaug Specs
|
||||
Karbor Specs
|
||||
===========
|
||||
|
||||
This section contains detailed specification documents for
|
||||
different features inside Smaug.
|
||||
different features inside Karbor.
|
||||
|
||||
Contents:
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
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.
|
||||
|
||||
Problem description
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
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
|
||||
===================
|
||||
|
@ -63,7 +63,7 @@ Protection Provider Configuration
|
|||
|
||||
Protection Providers are loaded from configuration files, placed in the
|
||||
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
|
||||
specifies the following configuration:
|
||||
|
||||
|
@ -85,11 +85,11 @@ For example::
|
|||
name = Foo
|
||||
id = 2e0c8826-81d6-44f5-bbe5-8f46a98c5845
|
||||
description = Example Protection Provider
|
||||
bank = smaug.protections.smaug-swift-bank-plugin
|
||||
plugin = smaug.protections.smaug-volume-protection-plugin
|
||||
plugin = smaug.protections.smaug-image-protection-plugin
|
||||
plugin = smaug.protections.smaug-server-protection-plugin
|
||||
plugin = smaug.protections.smaug-project-protection-plugin
|
||||
bank = karbor.protections.karbor-swift-bank-plugin
|
||||
plugin = karbor.protections.karbor-volume-protection-plugin
|
||||
plugin = karbor.protections.karbor-image-protection-plugin
|
||||
plugin = karbor.protections.karbor-server-protection-plugin
|
||||
plugin = karbor.protections.karbor-project-protection-plugin
|
||||
|
||||
[swift_client]
|
||||
bank_swift_auth_url = http://10.0.0.10:5000
|
||||
|
@ -166,7 +166,7 @@ Notes:
|
|||
else:
|
||||
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
|
||||
: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
|
||||
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
|
||||
:alt: Smaug
|
||||
.. image:: https://raw.githubusercontent.com/openstack/karbor/master/doc/images/pluggable_protection_provider.svg
|
||||
:alt: Karbor
|
||||
:align: center
|
||||
|
||||
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#>`_
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
width="630"
|
||||
height="400"
|
||||
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-ydpi="90">
|
||||
<metadata
|
||||
|
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
@ -2,7 +2,7 @@
|
|||
|
||||
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: execute task flow
|
||||
WorkflowEngine -> CreateCheckpointTask:execute()
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
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
|
||||
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.
|
||||
|
||||
It's also the role who actually cooperates with protection plugins provided by
|
||||
|
@ -29,7 +29,7 @@ the graph task flow.
|
|||
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
|
||||
calls:
|
||||
|
@ -56,7 +56,7 @@ Checkpoint RPC:
|
|||
|
||||
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
|
||||
|
@ -80,7 +80,7 @@ CheckpointCollection
|
|||
--------------------
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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
|
||||
events, will call RPC call of Protection Service:
|
||||
|
|
|
@ -10,7 +10,7 @@ Example Spec - The title of your 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
|
||||
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.
|
||||
|
||||
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?
|
||||
|
||||
|
||||
|
@ -143,7 +143,7 @@ but we're mostly trying to understand the timeline for implementation.
|
|||
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.
|
||||
|
||||
* If this requires functionality of another project that is not currently used
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
=============
|
||||
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.
|
||||
|
||||
|
||||
#. Before starting the smaug-protection service, the admin needs to configure a
|
||||
Provider in /etc/smaug/providers.d/openstack-infra.conf. The Swift plugin is
|
||||
#. Before starting the karbor-protection service, the admin needs to configure a
|
||||
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
|
||||
client account configuration::
|
||||
|
||||
|
@ -15,8 +15,8 @@ This example will show protecting volume.
|
|||
name = OS Infra Provider
|
||||
description = This provider uses OpenStack's own services (swift, cinder) as storage
|
||||
id = cf56bd3e-97a7-4078-b6d5-f36246333fd9
|
||||
plugin=smaug-volume-protection-plugin
|
||||
bank=smaug-swift-bank-plugin
|
||||
plugin=karbor-volume-protection-plugin
|
||||
bank=karbor-swift-bank-plugin
|
||||
|
||||
[swift_client]
|
||||
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::
|
||||
|
||||
export OS_USERNAME=admin
|
||||
|
@ -37,7 +37,7 @@ This example will show protecting volume.
|
|||
|
||||
#. Show the provider information::
|
||||
|
||||
smaug provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9
|
||||
karbor provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9
|
||||
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| Property | Value |
|
||||
+----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
@ -61,7 +61,7 @@ This example will show protecting volume.
|
|||
|
||||
#. List the protectable resources::
|
||||
|
||||
smaug protectable-list
|
||||
karbor protectable-list
|
||||
+-----------------------+
|
||||
| Protectable type |
|
||||
+-----------------------+
|
||||
|
@ -70,7 +70,7 @@ This example will show protecting volume.
|
|||
| OS::Nova::Server |
|
||||
+-----------------------+
|
||||
|
||||
smaug protectable-list-instances OS::Cinder::Volume
|
||||
karbor protectable-list-instances OS::Cinder::Volume
|
||||
+--------------------------------------+--------------------+---------------------+
|
||||
| Id | Type | Dependent resources |
|
||||
+--------------------------------------+--------------------+---------------------+
|
||||
|
@ -81,7 +81,7 @@ This example will show protecting volume.
|
|||
|
||||
#. 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 |
|
||||
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
@ -95,7 +95,7 @@ This example will show protecting volume.
|
|||
|
||||
#. 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 |
|
||||
|
@ -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 |
|
||||
| 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::
|
||||
|
||||
smaug 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 trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2":"format"="crontab"
|
||||
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::
|
||||
|
||||
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 |
|
||||
+----------------+-------------------------------------------------+
|
||||
|
@ -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 |
|
||||
+--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+
|
||||
|
||||
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
|
||||
+----+-----------+--------+------+------+--------------+-----------+
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
# OpenStack #
|
||||
#############
|
||||
|
||||
[composite:osapi_smaug]
|
||||
[composite:osapi_karbor]
|
||||
use = egg:Paste#urlmap
|
||||
/: apiversions
|
||||
/v1: openstack_smaug_api_v1
|
||||
/v1: openstack_karbor_api_v1
|
||||
|
||||
[composite:openstack_smaug_api_v1]
|
||||
use = call:smaug.api.middleware.auth:pipeline_factory
|
||||
[composite:openstack_karbor_api_v1]
|
||||
use = call:karbor.api.middleware.auth:pipeline_factory
|
||||
noauth = request_id catch_errors noauth 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
|
||||
|
||||
[filter:noauth]
|
||||
paste.filter_factory = smaug.api.middleware.auth:NoAuthMiddleware.factory
|
||||
paste.filter_factory = karbor.api.middleware.auth:NoAuthMiddleware.factory
|
||||
|
||||
[filter:keystonecontext]
|
||||
paste.filter_factory = smaug.api.middleware.auth:SmaugKeystoneContext.factory
|
||||
paste.filter_factory = karbor.api.middleware.auth:KarborKeystoneContext.factory
|
||||
|
||||
[filter:authtoken]
|
||||
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
|
||||
|
||||
[app:apiversions]
|
||||
paste.app_factory = smaug.api.versions:Versions.factory
|
||||
paste.app_factory = karbor.api.versions:Versions.factory
|
||||
|
||||
[app:apiv1]
|
||||
paste.app_factory = smaug.api.v1.router:APIRouter.factory
|
||||
paste.app_factory = karbor.api.v1.router:APIRouter.factory
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
[keystone_authtoken]
|
||||
#signing_dir = /var/cache/smaug
|
||||
#signing_dir = /var/cache/karbor
|
||||
#cafile = /opt/stack/data/ca-bundle.pem
|
||||
#auth_uri = http://192.168.1.102:5000
|
||||
#project_domain_id = default
|
||||
#project_name = service
|
||||
#user_domain_id = default
|
||||
#password = nomoresecrete
|
||||
#username = smaug
|
||||
#username = karbor
|
||||
#auth_url = http://http://192.168.1.102:35357
|
||||
#auth_plugin = password
|
||||
|
||||
[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_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
|
||||
|
@ -23,7 +23,7 @@
|
|||
#rpc_backend = rabbit
|
||||
|
||||
#[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]
|
||||
#rabbit_userid = stackrabbit
|
|
@ -3,9 +3,9 @@ name = OS Infra Provider
|
|||
description = This provider uses OpenStack's own services (swift, cinder) as storage
|
||||
id = cf56bd3e-97a7-4078-b6d5-f36246333fd9
|
||||
|
||||
plugin=smaug-volume-protection-plugin
|
||||
plugin=smaug-image-protection-plugin
|
||||
bank=smaug-swift-bank-plugin
|
||||
plugin=karbor-volume-protection-plugin
|
||||
plugin=karbor-image-protection-plugin
|
||||
bank=karbor-swift-bank-plugin
|
||||
|
||||
[swift_client]
|
||||
swift_auth_url=http://127.0.0.1:5000/v2.0/
|
||||
|
|
|
@ -16,4 +16,4 @@ import pbr.version
|
|||
|
||||
|
||||
__version__ = pbr.version.VersionInfo(
|
||||
'smaug').version_string()
|
||||
'karbor').version_string()
|
|
@ -19,7 +19,7 @@ from oslo_log import log as logging
|
|||
from six.moves import urllib
|
||||
import webob
|
||||
|
||||
from smaug.i18n import _
|
||||
from karbor.i18n import _
|
||||
|
||||
|
||||
api_common_opts = [
|
||||
|
@ -159,7 +159,7 @@ def get_sort_params(params, default_key='created_at', default_dir='desc'):
|
|||
function.
|
||||
|
||||
: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
|
||||
sort keys are supplied
|
||||
: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):
|
||||
"""Removes the first api version from the href.
|
||||
|
||||
Given: 'http://www.smaug.com/v1.1/123'
|
||||
Returns: 'http://www.smaug.com/123'
|
||||
Given: 'http://www.karbor.com/v1.1/123'
|
||||
Returns: 'http://www.karbor.com/123'
|
||||
|
||||
Given: 'http://www.smaug.com/v1.1'
|
||||
Returns: 'http://www.smaug.com'
|
||||
Given: 'http://www.karbor.com/v1.1'
|
||||
Returns: 'http://www.karbor.com'
|
||||
|
||||
"""
|
||||
parsed_url = urllib.parse.urlsplit(href)
|
||||
|
@ -249,7 +249,7 @@ class ViewBuilder(object):
|
|||
prefix = self._update_link_prefix(get_request_url(request),
|
||||
CONF.osapi_plan_base_URL)
|
||||
url = os.path.join(prefix,
|
||||
request.environ["smaug.context"].project_id,
|
||||
request.environ["karbor.context"].project_id,
|
||||
collection_name)
|
||||
return "%s?%s" % (url, urllib.parse.urlencode(params))
|
||||
|
||||
|
@ -258,7 +258,7 @@ class ViewBuilder(object):
|
|||
prefix = self._update_link_prefix(get_request_url(request),
|
||||
CONF.osapi_plan_base_URL)
|
||||
return os.path.join(prefix,
|
||||
request.environ["smaug.context"].project_id,
|
||||
request.environ["karbor.context"].project_id,
|
||||
self._collection_name,
|
||||
str(identifier))
|
||||
|
||||
|
@ -268,7 +268,7 @@ class ViewBuilder(object):
|
|||
base_url = self._update_link_prefix(base_url,
|
||||
CONF.osapi_plan_base_URL)
|
||||
return os.path.join(base_url,
|
||||
request.environ["smaug.context"].project_id,
|
||||
request.environ["karbor.context"].project_id,
|
||||
self._collection_name,
|
||||
str(identifier))
|
||||
|
|
@ -27,10 +27,10 @@ from oslo_serialization import jsonutils
|
|||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import context
|
||||
from smaug.i18n import _
|
||||
from smaug.wsgi import common as base_wsgi
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import context
|
||||
from karbor.i18n import _
|
||||
from karbor.wsgi import common as base_wsgi
|
||||
|
||||
|
||||
use_forwarded_for_opt = cfg.BoolOpt(
|
||||
|
@ -58,7 +58,7 @@ def pipeline_factory(loader, global_conf, **local_conf):
|
|||
|
||||
|
||||
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):
|
||||
self.context = context
|
||||
|
@ -66,11 +66,11 @@ class InjectContext(base_wsgi.Middleware):
|
|||
|
||||
@webob.dec.wsgify(RequestClass=base_wsgi.Request)
|
||||
def __call__(self, req):
|
||||
req.environ['smaug.context'] = self.context
|
||||
req.environ['karbor.context'] = self.context
|
||||
return self.application
|
||||
|
||||
|
||||
class SmaugKeystoneContext(base_wsgi.Middleware):
|
||||
class KarborKeystoneContext(base_wsgi.Middleware):
|
||||
"""Make a request context from keystone headers."""
|
||||
|
||||
@webob.dec.wsgify(RequestClass=base_wsgi.Request)
|
||||
|
@ -125,7 +125,7 @@ class SmaugKeystoneContext(base_wsgi.Middleware):
|
|||
request_id=req_id,
|
||||
auth_token_info=auth_token_info)
|
||||
|
||||
environ['smaug.context'] = ctx
|
||||
environ['karbor.context'] = ctx
|
||||
return self.application
|
||||
|
||||
|
||||
|
@ -159,5 +159,5 @@ class NoAuthMiddleware(base_wsgi.Middleware):
|
|||
is_admin=True,
|
||||
remote_address=remote_address)
|
||||
|
||||
req.environ['smaug.context'] = ctx
|
||||
req.environ['karbor.context'] = ctx
|
||||
return self.application
|
|
@ -20,11 +20,11 @@ from oslo_utils import excutils
|
|||
import six
|
||||
import webob
|
||||
|
||||
from smaug import exception
|
||||
from smaug import i18n
|
||||
from smaug.i18n import _, _LE, _LI
|
||||
from smaug import utils
|
||||
from smaug.wsgi import common as wsgi
|
||||
from karbor import exception
|
||||
from karbor import i18n
|
||||
from karbor.i18n import _, _LE, _LI
|
||||
from karbor import utils
|
||||
from karbor.wsgi import common as wsgi
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -620,7 +620,7 @@ class Resource(wsgi.Application):
|
|||
action_args.update(contents)
|
||||
|
||||
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)):
|
||||
msg = _("Malformed request url")
|
||||
return Fault(webob.exc.HTTPBadRequest(explanation=msg))
|
||||
|
@ -962,7 +962,7 @@ class Fault(webob.exc.HTTPException):
|
|||
|
||||
|
||||
def _set_request_id_header(req, headers):
|
||||
context = req.environ.get('smaug.context')
|
||||
context = req.environ.get('karbor.context')
|
||||
if context:
|
||||
headers['x-compute-request-id'] = context.request_id
|
||||
|
|
@ -18,17 +18,17 @@ from oslo_utils import uuidutils
|
|||
|
||||
from webob import exc
|
||||
|
||||
import smaug
|
||||
from smaug.api import common
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import exception
|
||||
from smaug.i18n import _, _LI
|
||||
import karbor
|
||||
from karbor.api import common
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import exception
|
||||
from karbor.i18n import _, _LI
|
||||
|
||||
from smaug import objects
|
||||
from smaug.objects import base as objects_base
|
||||
import smaug.policy
|
||||
from smaug.services.operationengine import api as operationengine_api
|
||||
from smaug import utils
|
||||
from karbor import objects
|
||||
from karbor.objects import base as objects_base
|
||||
import karbor.policy
|
||||
from karbor.services.operationengine import api as operationengine_api
|
||||
from karbor import utils
|
||||
|
||||
import six
|
||||
|
||||
|
@ -50,7 +50,7 @@ def check_policy(context, action, target_obj=None):
|
|||
'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
|
||||
target.update(
|
||||
target_obj.obj_to_primitive() or {})
|
||||
|
@ -58,7 +58,7 @@ def check_policy(context, action, target_obj=None):
|
|||
target.update(target_obj or {})
|
||||
|
||||
_action = 'plan:%s' % action
|
||||
smaug.policy.enforce(context, _action, target)
|
||||
karbor.policy.enforce(context, _action, target)
|
||||
|
||||
|
||||
class PlanViewBuilder(common.ViewBuilder):
|
||||
|
@ -126,7 +126,7 @@ class PlansController(wsgi.Controller):
|
|||
|
||||
def show(self, req, id):
|
||||
"""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)
|
||||
|
||||
|
@ -145,7 +145,7 @@ class PlansController(wsgi.Controller):
|
|||
|
||||
def delete(self, req, id):
|
||||
"""Delete a plan."""
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
|
||||
LOG.info(_LI("Delete plan with id: %s"), id, context=context)
|
||||
|
||||
|
@ -161,7 +161,7 @@ class PlansController(wsgi.Controller):
|
|||
|
||||
def index(self, req):
|
||||
"""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)
|
||||
|
||||
|
@ -236,7 +236,7 @@ class PlansController(wsgi.Controller):
|
|||
raise exc.HTTPUnprocessableEntity()
|
||||
|
||||
LOG.debug('Create plan request body: %s', body)
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
check_policy(context, 'create')
|
||||
plan = body['plan']
|
||||
LOG.debug('Create plan request plan: %s', plan)
|
||||
|
@ -278,7 +278,7 @@ class PlansController(wsgi.Controller):
|
|||
|
||||
def update(self, req, id, body):
|
||||
"""Update a plan."""
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
|
||||
if not body:
|
||||
msg = _("Missing request body")
|
||||
|
@ -333,7 +333,7 @@ class PlansController(wsgi.Controller):
|
|||
try:
|
||||
check_policy(context, 'get', plan)
|
||||
except exception.PolicyNotAuthorized:
|
||||
# raise PlanNotFound instead to make sure smaug behaves
|
||||
# raise PlanNotFound instead to make sure karbor behaves
|
||||
# as it used to
|
||||
raise exception.PlanNotFound(plan_id=plan_id)
|
||||
LOG.info(_LI("Plan info retrieved successfully."), resource=plan)
|
||||
|
@ -347,13 +347,13 @@ class PlansController(wsgi.Controller):
|
|||
raise exception.InvalidPlan(reason=msg)
|
||||
# TODO(chenying) replication scene: need call rpc API when
|
||||
# the status of the plan is changed.
|
||||
if isinstance(plan, objects_base.SmaugObject):
|
||||
if isinstance(plan, objects_base.KarborObject):
|
||||
plan.update(fields)
|
||||
plan.save()
|
||||
LOG.info(_LI("Plan updated successfully."), resource=plan)
|
||||
else:
|
||||
msg = _("The parameter plan must be a object of "
|
||||
"SmaugObject class.")
|
||||
"KarborObject class.")
|
||||
raise exception.InvalidInput(reason=msg)
|
||||
|
||||
def validate_plan_resources(self, plan):
|
|
@ -17,14 +17,14 @@ from oslo_log import log as logging
|
|||
|
||||
from webob import exc
|
||||
|
||||
from smaug.api import common
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import exception
|
||||
from smaug.i18n import _, _LI
|
||||
from karbor.api import common
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import exception
|
||||
from karbor.i18n import _, _LI
|
||||
|
||||
import smaug.policy
|
||||
from smaug.services.protection import api as protection_api
|
||||
from smaug import utils
|
||||
import karbor.policy
|
||||
from karbor.services.protection import api as protection_api
|
||||
from karbor import utils
|
||||
|
||||
import six
|
||||
|
||||
|
@ -46,7 +46,7 @@ def check_policy(context, action):
|
|||
'user_id': context.user_id,
|
||||
}
|
||||
_action = 'protectable:%s' % action
|
||||
smaug.policy.enforce(context, _action, target)
|
||||
karbor.policy.enforce(context, _action, target)
|
||||
|
||||
|
||||
class ProtectableViewBuilder(common.ViewBuilder):
|
||||
|
@ -124,7 +124,7 @@ class ProtectablesController(wsgi.Controller):
|
|||
|
||||
def show(self, req, id):
|
||||
"""Return data about the given protectable_type."""
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
protectable_type = id
|
||||
LOG.info(_LI("Show the information of a given"
|
||||
" protectable type: %s"), protectable_type)
|
||||
|
@ -151,7 +151,7 @@ class ProtectablesController(wsgi.Controller):
|
|||
|
||||
transformed through view builder.
|
||||
"""
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
LOG.info(_LI("Show protectable type list"), context=context)
|
||||
|
||||
protectable_types = self._get_all(context)
|
||||
|
@ -173,7 +173,7 @@ class ProtectablesController(wsgi.Controller):
|
|||
|
||||
def instances_index(self, req, 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"
|
||||
" protectable type: %s"), protectable_type)
|
||||
|
||||
|
@ -252,7 +252,7 @@ class ProtectablesController(wsgi.Controller):
|
|||
def instances_show(self, req, protectable_type, protectable_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"
|
||||
" type: %s"), protectable_type)
|
||||
|
|
@ -18,15 +18,15 @@ from oslo_utils import uuidutils
|
|||
|
||||
from webob import exc
|
||||
|
||||
from smaug.api import common
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import exception
|
||||
from smaug.i18n import _, _LI
|
||||
from karbor.api import common
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import exception
|
||||
from karbor.i18n import _, _LI
|
||||
|
||||
from smaug import objects
|
||||
import smaug.policy
|
||||
from smaug.services.protection import api as protection_api
|
||||
from smaug import utils
|
||||
from karbor import objects
|
||||
import karbor.policy
|
||||
from karbor.services.protection import api as protection_api
|
||||
from karbor import utils
|
||||
|
||||
import six
|
||||
|
||||
|
@ -59,7 +59,7 @@ def check_policy(context, action):
|
|||
'user_id': context.user_id,
|
||||
}
|
||||
_action = 'provider:%s' % action
|
||||
smaug.policy.enforce(context, _action, target)
|
||||
karbor.policy.enforce(context, _action, target)
|
||||
|
||||
|
||||
class ProviderViewBuilder(common.ViewBuilder):
|
||||
|
@ -183,7 +183,7 @@ class ProvidersController(wsgi.Controller):
|
|||
|
||||
def show(self, req, 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)
|
||||
|
||||
|
@ -198,7 +198,7 @@ class ProvidersController(wsgi.Controller):
|
|||
|
||||
def index(self, req):
|
||||
"""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)
|
||||
|
||||
|
@ -275,7 +275,7 @@ class ProvidersController(wsgi.Controller):
|
|||
try:
|
||||
check_policy(context, 'get')
|
||||
except exception.PolicyNotAuthorized:
|
||||
# raise ProviderNotFound instead to make sure smaug behaves
|
||||
# raise ProviderNotFound instead to make sure karbor behaves
|
||||
# as it used to
|
||||
raise exception.ProviderNotFound(provider_id=provider_id)
|
||||
|
||||
|
@ -286,7 +286,7 @@ class ProvidersController(wsgi.Controller):
|
|||
|
||||
def checkpoints_index(self, req, provider_id):
|
||||
"""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. "
|
||||
"provider_id:%s"), provider_id)
|
||||
|
@ -350,7 +350,7 @@ class ProvidersController(wsgi.Controller):
|
|||
if not self.is_valid_body(body, 'checkpoint'):
|
||||
raise exc.HTTPUnprocessableEntity()
|
||||
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
|
||||
LOG.debug('Create checkpoint request '
|
||||
'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):
|
||||
"""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."),
|
||||
checkpoint_id)
|
||||
|
@ -433,7 +433,7 @@ class ProvidersController(wsgi.Controller):
|
|||
try:
|
||||
check_policy(context, 'checkpoint_get')
|
||||
except exception.PolicyNotAuthorized:
|
||||
# raise CheckpointNotFound instead to make sure smaug behaves
|
||||
# raise CheckpointNotFound instead to make sure karbor behaves
|
||||
# as it used to
|
||||
raise exception.CheckpointNotFound(checkpoint_id=checkpoint_id)
|
||||
|
||||
|
@ -448,7 +448,7 @@ class ProvidersController(wsgi.Controller):
|
|||
|
||||
def checkpoints_delete(self, req, provider_id, checkpoint_id):
|
||||
"""Delete a checkpoint."""
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
|
||||
LOG.info(_LI("Delete checkpoint with id: %s."),
|
||||
checkpoint_id)
|
|
@ -18,17 +18,17 @@ from oslo_utils import uuidutils
|
|||
|
||||
from webob import exc
|
||||
|
||||
import smaug
|
||||
from smaug.api import common
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import exception
|
||||
from smaug.i18n import _, _LI
|
||||
import karbor
|
||||
from karbor.api import common
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import exception
|
||||
from karbor.i18n import _, _LI
|
||||
|
||||
from smaug import objects
|
||||
from smaug.objects import base as objects_base
|
||||
import smaug.policy
|
||||
from smaug.services.protection import api as protection_api
|
||||
from smaug import utils
|
||||
from karbor import objects
|
||||
from karbor.objects import base as objects_base
|
||||
import karbor.policy
|
||||
from karbor.services.protection import api as protection_api
|
||||
from karbor import utils
|
||||
|
||||
import six
|
||||
|
||||
|
@ -51,7 +51,7 @@ def check_policy(context, action, target_obj=None):
|
|||
'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
|
||||
target.update(
|
||||
target_obj.obj_to_primitive() or {})
|
||||
|
@ -59,7 +59,7 @@ def check_policy(context, action, target_obj=None):
|
|||
target.update(target_obj or {})
|
||||
|
||||
_action = 'restore:%s' % action
|
||||
smaug.policy.enforce(context, _action, target)
|
||||
karbor.policy.enforce(context, _action, target)
|
||||
|
||||
|
||||
class RestoreViewBuilder(common.ViewBuilder):
|
||||
|
@ -130,7 +130,7 @@ class RestoresController(wsgi.Controller):
|
|||
|
||||
def show(self, req, id):
|
||||
"""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)
|
||||
|
||||
|
@ -149,7 +149,7 @@ class RestoresController(wsgi.Controller):
|
|||
|
||||
def index(self, req):
|
||||
"""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)
|
||||
|
||||
|
@ -226,7 +226,7 @@ class RestoresController(wsgi.Controller):
|
|||
raise exc.HTTPUnprocessableEntity()
|
||||
|
||||
LOG.debug('Create restore request body: %s', body)
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
check_policy(context, 'create')
|
||||
restore = body['restore']
|
||||
LOG.debug('Create restore request : %s', restore)
|
||||
|
@ -290,7 +290,7 @@ class RestoresController(wsgi.Controller):
|
|||
try:
|
||||
check_policy(context, 'get', restore)
|
||||
except exception.PolicyNotAuthorized:
|
||||
# raise RestoreNotFound instead to make sure smaug behaves
|
||||
# raise RestoreNotFound instead to make sure karbor behaves
|
||||
# as it used to
|
||||
raise exception.RestoreNotFound(restore_id=restore_id)
|
||||
LOG.info(_LI("Restore info retrieved successfully."))
|
||||
|
@ -302,13 +302,13 @@ class RestoresController(wsgi.Controller):
|
|||
except exception.RestoreNotFound as error:
|
||||
raise exc.HTTPNotFound(explanation=error.msg)
|
||||
|
||||
if isinstance(restore, objects_base.SmaugObject):
|
||||
if isinstance(restore, objects_base.KarborObject):
|
||||
restore.update(fields)
|
||||
restore.save()
|
||||
LOG.info(_LI("restore updated successfully."))
|
||||
else:
|
||||
msg = _("The parameter restore must be a object of "
|
||||
"SmaugObject class.")
|
||||
"KarborObject class.")
|
||||
raise exception.InvalidInput(reason=msg)
|
||||
|
||||
|
|
@ -10,14 +10,14 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from smaug.api.openstack import ProjectMapper
|
||||
from smaug.api.v1 import plans
|
||||
from smaug.api.v1 import protectables
|
||||
from smaug.api.v1 import providers
|
||||
from smaug.api.v1 import restores
|
||||
from smaug.api.v1 import scheduled_operations
|
||||
from smaug.api.v1 import triggers
|
||||
from smaug.wsgi import common as wsgi_common
|
||||
from karbor.api.openstack import ProjectMapper
|
||||
from karbor.api.v1 import plans
|
||||
from karbor.api.v1 import protectables
|
||||
from karbor.api.v1 import providers
|
||||
from karbor.api.v1 import restores
|
||||
from karbor.api.v1 import scheduled_operations
|
||||
from karbor.api.v1 import triggers
|
||||
from karbor.wsgi import common as wsgi_common
|
||||
|
||||
|
||||
class APIRouter(wsgi_common.Router):
|
|
@ -16,15 +16,15 @@ from oslo_log import log as logging
|
|||
from oslo_utils import uuidutils
|
||||
from webob import exc
|
||||
|
||||
from smaug.api import common
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug import policy
|
||||
from smaug.services.operationengine import api as operationengine_api
|
||||
from smaug.services.operationengine import operation_manager
|
||||
from smaug import utils
|
||||
from karbor.api import common
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor import policy
|
||||
from karbor.services.operationengine import api as operationengine_api
|
||||
from karbor.services.operationengine import operation_manager
|
||||
from karbor import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -94,7 +94,7 @@ class ScheduledOperationController(wsgi.Controller):
|
|||
raise exc.HTTPUnprocessableEntity()
|
||||
LOG.debug('Create a scheduled operation, request body: %s', body)
|
||||
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
check_policy(context, 'create')
|
||||
operation_info = body['scheduled_operation']
|
||||
|
||||
|
@ -156,7 +156,7 @@ class ScheduledOperationController(wsgi.Controller):
|
|||
|
||||
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'])
|
||||
trigger = operation.trigger
|
||||
|
||||
|
@ -178,7 +178,7 @@ class ScheduledOperationController(wsgi.Controller):
|
|||
|
||||
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)
|
||||
check_policy(context, 'get', operation)
|
||||
|
||||
|
@ -187,7 +187,7 @@ class ScheduledOperationController(wsgi.Controller):
|
|||
def index(self, req):
|
||||
"""Returns a list of operations, transformed through view builder."""
|
||||
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
check_policy(context, 'list')
|
||||
|
||||
params = req.params.copy()
|
||||
|
@ -257,11 +257,11 @@ class ScheduledOperationController(wsgi.Controller):
|
|||
|
||||
def _raise_unknown_exception(self, exception_instance):
|
||||
value = exception_instance.msg if isinstance(
|
||||
exception_instance, exception.SmaugException) else type(
|
||||
exception_instance, exception.KarborException) else type(
|
||||
exception_instance)
|
||||
msg = (_('Unexpected API Error. Please report this at '
|
||||
'http://bugs.launchpad.net/smaug/ and attach the '
|
||||
'Smaug API log if possible.\n%s') % value)
|
||||
'http://bugs.launchpad.net/karbor/ and attach the '
|
||||
'Karbor API log if possible.\n%s') % value)
|
||||
raise exc.HTTPInternalServerError(explanation=msg)
|
||||
|
||||
|
|
@ -18,14 +18,14 @@ from oslo_utils import uuidutils
|
|||
import uuid
|
||||
from webob import exc
|
||||
|
||||
from smaug.api import common
|
||||
from smaug.api.openstack import wsgi
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug import policy
|
||||
from smaug.services.operationengine import api as operationengine_api
|
||||
from smaug import utils
|
||||
from karbor.api import common
|
||||
from karbor.api.openstack import wsgi
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor import policy
|
||||
from karbor.services.operationengine import api as operationengine_api
|
||||
from karbor import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -90,7 +90,7 @@ class TriggersController(wsgi.Controller):
|
|||
raise exc.HTTPUnprocessableEntity()
|
||||
LOG.debug('Create a trigger, request body: %s', body)
|
||||
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
check_policy(context, 'create')
|
||||
trigger_info = body['trigger_info']
|
||||
|
||||
|
@ -126,7 +126,7 @@ class TriggersController(wsgi.Controller):
|
|||
|
||||
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)
|
||||
|
||||
check_policy(context, 'delete', trigger)
|
||||
|
@ -157,7 +157,7 @@ class TriggersController(wsgi.Controller):
|
|||
|
||||
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)
|
||||
|
||||
check_policy(context, 'update', trigger)
|
||||
|
@ -190,7 +190,7 @@ class TriggersController(wsgi.Controller):
|
|||
|
||||
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)
|
||||
|
||||
check_policy(context, 'get', trigger)
|
||||
|
@ -199,7 +199,7 @@ class TriggersController(wsgi.Controller):
|
|||
def index(self, req):
|
||||
"""Returns a list of triggers, transformed through view builder."""
|
||||
|
||||
context = req.environ['smaug.context']
|
||||
context = req.environ['karbor.context']
|
||||
check_policy(context, 'list')
|
||||
|
||||
params = req.params.copy()
|
||||
|
@ -240,11 +240,11 @@ class TriggersController(wsgi.Controller):
|
|||
|
||||
def _raise_unknown_exception(self, exception_instance):
|
||||
value = exception_instance.msg if isinstance(
|
||||
exception_instance, exception.SmaugException) else type(
|
||||
exception_instance, exception.KarborException) else type(
|
||||
exception_instance)
|
||||
msg = (_('Unexpected API Error. Please report this at '
|
||||
'http://bugs.launchpad.net/smaug/ and attach the '
|
||||
'Smaug API log if possible.\n%s') % value)
|
||||
'http://bugs.launchpad.net/karbor/ and attach the '
|
||||
'Karbor API log if possible.\n%s') % value)
|
||||
raise exc.HTTPInternalServerError(explanation=msg)
|
||||
|
||||
|
|
@ -11,11 +11,11 @@
|
|||
# under the License.
|
||||
|
||||
import httplib
|
||||
from karbor.api.openstack import wsgi
|
||||
from oslo_log import log as logging
|
||||
import webob.dec
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
from smaug.api.openstack import wsgi
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
|
@ -11,7 +11,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Starter script for smaug OS API."""
|
||||
"""Starter script for karbor OS API."""
|
||||
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
@ -22,13 +22,13 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
|
||||
# Need to register global_opts
|
||||
from smaug.common import config # noqa
|
||||
from smaug import i18n
|
||||
from karbor.common import config # noqa
|
||||
from karbor import i18n
|
||||
i18n.enable_lazy()
|
||||
from smaug import objects
|
||||
from smaug import rpc
|
||||
from smaug import service
|
||||
from smaug import version
|
||||
from karbor import objects
|
||||
from karbor import rpc
|
||||
from karbor import service
|
||||
from karbor import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -36,12 +36,12 @@ CONF = cfg.CONF
|
|||
|
||||
def main():
|
||||
objects.register_all()
|
||||
CONF(sys.argv[1:], project='smaug',
|
||||
CONF(sys.argv[1:], project='karbor',
|
||||
version=version.version_string())
|
||||
logging.setup(CONF, "smaug")
|
||||
logging.setup(CONF, "karbor")
|
||||
|
||||
rpc.init(CONF)
|
||||
launcher = service.process_launcher()
|
||||
server = service.WSGIService('osapi_smaug')
|
||||
server = service.WSGIService('osapi_karbor')
|
||||
launcher.launch_service(server, workers=server.workers)
|
||||
launcher.wait()
|
|
@ -12,7 +12,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
"""
|
||||
CLI interface for smaug management.
|
||||
CLI interface for karbor management.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
@ -25,19 +25,19 @@ from oslo_config import cfg
|
|||
from oslo_db.sqlalchemy import migration
|
||||
from oslo_log import log as logging
|
||||
|
||||
from smaug import i18n
|
||||
from karbor import i18n
|
||||
i18n.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from smaug.common import config # noqa
|
||||
from smaug import context
|
||||
from smaug import db
|
||||
from smaug.db import migration as db_migration
|
||||
from smaug.db.sqlalchemy import api as db_api
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug import utils
|
||||
from smaug import version
|
||||
from karbor.common import config # noqa
|
||||
from karbor import context
|
||||
from karbor import db
|
||||
from karbor.db import migration as db_migration
|
||||
from karbor.db.sqlalchemy import api as db_api
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor import utils
|
||||
from karbor import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -93,9 +93,9 @@ class ConfigCommands(object):
|
|||
@args('param', nargs='?', default=None,
|
||||
help='Configuration parameter to display (default: %(default)s)')
|
||||
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
|
||||
requested parameter. If the parameter is not found an appropriate
|
||||
error is produced by .get*().
|
||||
|
@ -111,7 +111,7 @@ class ConfigCommands(object):
|
|||
class ServiceCommands(object):
|
||||
"""Methods for managing services."""
|
||||
def list(self):
|
||||
"""Show a list of all smaug services."""
|
||||
"""Show a list of all karbor services."""
|
||||
|
||||
ctxt = context.get_admin_context()
|
||||
services = db.service_get_all(ctxt)
|
||||
|
@ -210,7 +210,7 @@ def main():
|
|||
CONF.register_cli_opt(category_opt)
|
||||
script_name = sys.argv[0]
|
||||
if len(sys.argv) < 2:
|
||||
print(_("\nOpenStack Smaug version: %(version)s\n") %
|
||||
print(_("\nOpenStack Karbor version: %(version)s\n") %
|
||||
{'version': version.version_string()})
|
||||
print(script_name + " category action [<args>]")
|
||||
print(_("Available categories:"))
|
||||
|
@ -219,9 +219,9 @@ def main():
|
|||
sys.exit(2)
|
||||
|
||||
try:
|
||||
CONF(sys.argv[1:], project='smaug',
|
||||
CONF(sys.argv[1:], project='karbor',
|
||||
version=version.version_string())
|
||||
logging.setup(CONF, "smaug")
|
||||
logging.setup(CONF, "karbor")
|
||||
except cfg.ConfigDirNotFoundError as details:
|
||||
print(_("Invalid directory: %s") % details)
|
||||
sys.exit(2)
|
||||
|
@ -237,7 +237,7 @@ def main():
|
|||
except Exception:
|
||||
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)
|
||||
|
||||
fn = CONF.category.action_fn
|
|
@ -11,7 +11,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Starter script for smaug OperationEngine."""
|
||||
"""Starter script for karbor OperationEngine."""
|
||||
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
@ -21,14 +21,14 @@ import sys
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from smaug import i18n
|
||||
from karbor import i18n
|
||||
i18n.enable_lazy()
|
||||
from smaug import objects
|
||||
from karbor import objects
|
||||
|
||||
# Need to register global_opts
|
||||
from smaug.common import config # noqa
|
||||
from smaug import service
|
||||
from smaug import version
|
||||
from karbor.common import config # noqa
|
||||
from karbor import service
|
||||
from karbor import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -36,9 +36,9 @@ CONF = cfg.CONF
|
|||
|
||||
def main():
|
||||
objects.register_all()
|
||||
CONF(sys.argv[1:], project='smaug',
|
||||
CONF(sys.argv[1:], project='karbor',
|
||||
version=version.version_string())
|
||||
logging.setup(CONF, "smaug")
|
||||
server = service.Service.create(binary='smaug-operationengine')
|
||||
logging.setup(CONF, "karbor")
|
||||
server = service.Service.create(binary='karbor-operationengine')
|
||||
service.serve(server)
|
||||
service.wait()
|
|
@ -11,7 +11,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Starter script for smaug protection service."""
|
||||
"""Starter script for karbor protection service."""
|
||||
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
@ -21,14 +21,14 @@ import sys
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from smaug import i18n
|
||||
from karbor import i18n
|
||||
i18n.enable_lazy()
|
||||
from smaug import objects
|
||||
from karbor import objects
|
||||
|
||||
# Need to register global_opts
|
||||
from smaug.common import config # noqa
|
||||
from smaug import service
|
||||
from smaug import version
|
||||
from karbor.common import config # noqa
|
||||
from karbor import service
|
||||
from karbor import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -36,9 +36,9 @@ CONF = cfg.CONF
|
|||
|
||||
def main():
|
||||
objects.register_all()
|
||||
CONF(sys.argv[1:], project='smaug',
|
||||
CONF(sys.argv[1:], project='karbor',
|
||||
version=version.version_string())
|
||||
logging.setup(CONF, "smaug")
|
||||
server = service.Service.create(binary='smaug-protection')
|
||||
logging.setup(CONF, "karbor")
|
||||
server = service.Service.create(binary='karbor-protection')
|
||||
service.serve(server)
|
||||
service.wait()
|
|
@ -31,11 +31,11 @@ logging.register_options(CONF)
|
|||
core_opts = [
|
||||
cfg.StrOpt('api_paste_config',
|
||||
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',
|
||||
default='/var/lib/smaug',
|
||||
default='/var/lib/karbor',
|
||||
deprecated_name='pybasedir',
|
||||
help="Top-level directory for maintaining smaug's state"),
|
||||
help="Top-level directory for maintaining karbor's state"),
|
||||
]
|
||||
|
||||
debug_opts = [
|
||||
|
@ -50,17 +50,17 @@ global_opts = [
|
|||
help='Maximum time since last check-in for a service to be '
|
||||
'considered up'),
|
||||
cfg.StrOpt('operationengine_topic',
|
||||
default='smaug-operationengine',
|
||||
default='karbor-operationengine',
|
||||
help='The topic that OperationEngine nodes listen on'),
|
||||
cfg.StrOpt('operationengine_manager',
|
||||
default='smaug.services.operationengine.manager.'
|
||||
default='karbor.services.operationengine.manager.'
|
||||
'OperationEngineManager',
|
||||
help='Full class name for the Manager for OperationEngine'),
|
||||
cfg.StrOpt('protection_topic',
|
||||
default='smaug-protection',
|
||||
default='karbor-protection',
|
||||
help='The topic that protection nodes listen on'),
|
||||
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'),
|
||||
cfg.StrOpt('host',
|
||||
default=socket.gethostname(),
|
|
@ -18,9 +18,9 @@ from keystoneclient.v3 import client as kc_v3
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from smaug import exception
|
||||
from smaug.i18n import _LW
|
||||
from smaug import utils
|
||||
from karbor import exception
|
||||
from karbor.i18n import _LW
|
||||
from karbor import utils
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -31,40 +31,40 @@ CONF = cfg.CONF
|
|||
# [trustee]
|
||||
# auth_type = password
|
||||
# auth_url = http://192.168.1.2:35357
|
||||
# username = smaug
|
||||
# username = karbor
|
||||
# password = password
|
||||
# user_domain_id = default
|
||||
TRUSTEE_CONF_GROUP = 'trustee'
|
||||
loading.register_auth_conf_options(CONF, TRUSTEE_CONF_GROUP)
|
||||
|
||||
|
||||
class SmaugKeystonePlugin(object):
|
||||
"""Contruct a keystone client plugin with Smaug user
|
||||
class KarborKeystonePlugin(object):
|
||||
"""Contruct a keystone client plugin with karbor user
|
||||
|
||||
to offer the following functions:
|
||||
|
||||
1. get the endpoint of service, such as nova, cinder
|
||||
2. create trust to smaug
|
||||
2. create trust to karbor
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self._client = None
|
||||
self._auth_uri = ""
|
||||
self._smaug_user_id = ""
|
||||
self._karbor_user_id = ""
|
||||
|
||||
self._do_init()
|
||||
|
||||
def _do_init(self):
|
||||
auth_plugin = self._get_smaug_auth_plugin()
|
||||
# set the project which smaug belongs to
|
||||
auth_plugin = self._get_karbor_auth_plugin()
|
||||
# set the project which karbor belongs to
|
||||
auth_plugin._project_name = "service"
|
||||
auth_plugin._project_domain_id = "default"
|
||||
|
||||
self._client = self._get_keystone_client(auth_plugin)
|
||||
|
||||
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)
|
||||
|
||||
try:
|
||||
|
@ -93,7 +93,7 @@ class SmaugKeystonePlugin(object):
|
|||
msg = ('get service(%s) endpoint failed' % service_name)
|
||||
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:
|
||||
msg = ("user=%s, project=%s" % (context.user_id,
|
||||
context.project_id))
|
||||
|
@ -106,7 +106,7 @@ class SmaugKeystonePlugin(object):
|
|||
l_kc_v3 = self._get_keystone_client(user_auth_plugin)
|
||||
try:
|
||||
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,
|
||||
impersonation=True,
|
||||
role_names=context.roles)
|
||||
|
@ -115,13 +115,13 @@ class SmaugKeystonePlugin(object):
|
|||
except Exception as e:
|
||||
raise exception.AuthorizationFailure(obj=str(e))
|
||||
|
||||
def delete_trust_to_smaug(self, trust_id):
|
||||
auth_plugin = self._get_smaug_auth_plugin(trust_id)
|
||||
def delete_trust_to_karbor(self, trust_id):
|
||||
auth_plugin = self._get_karbor_auth_plugin(trust_id)
|
||||
client = self._get_keystone_client(auth_plugin)
|
||||
client.trusts.delete(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)
|
||||
|
||||
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)
|
||||
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(
|
||||
CONF, TRUSTEE_CONF_GROUP, trust_id=trust_id)
|
||||
|
||||
if not auth_plugin:
|
||||
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)
|
||||
raise exception.AuthorizationFailure(obj=TRUSTEE_CONF_GROUP)
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# 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
|
||||
|
||||
|
@ -22,8 +22,8 @@ from oslo_log import log as logging
|
|||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
from smaug.i18n import _
|
||||
from smaug import policy
|
||||
from karbor.i18n import _
|
||||
from karbor import policy
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""
|
||||
DB abstraction for smaug
|
||||
DB abstraction for karbor
|
||||
"""
|
||||
|
||||
from smaug.db.api import * # noqa
|
||||
from karbor.db.api import * # noqa
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
"""Defines interface for DB access.
|
||||
|
||||
Functions in this module are imported into the smaug.db namespace. Call these
|
||||
functions from smaug.db namespace, not the smaug.db.api namespace.
|
||||
Functions in this module are imported into the karbor.db namespace. Call these
|
||||
functions from karbor.db namespace, not the karbor.db.api namespace.
|
||||
|
||||
All functions in this module return objects that implement a dictionary-like
|
||||
interface. Currently, many of these objects are sqlalchemy objects that
|
||||
|
@ -24,7 +24,7 @@ these objects be simple dictionaries.
|
|||
**Related Flags**
|
||||
|
||||
: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
|
||||
pool of available hardware (Default: True)
|
||||
|
@ -46,9 +46,9 @@ db_opts = [
|
|||
CONF = cfg.CONF
|
||||
CONF.register_opts(db_opts)
|
||||
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)
|
|
@ -18,7 +18,7 @@ from oslo_utils import importutils
|
|||
|
||||
|
||||
db_driver_opt = cfg.StrOpt('db_driver',
|
||||
default='smaug.db',
|
||||
default='karbor.db',
|
||||
help='Driver to use for database access')
|
||||
|
||||
CONF = cfg.CONF
|
|
@ -19,7 +19,7 @@ from oslo_config import cfg
|
|||
from oslo_db import options
|
||||
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
|
||||
|
||||
|
@ -41,7 +41,7 @@ def get_backend():
|
|||
with _LOCK:
|
||||
if _IMPL is None:
|
||||
_IMPL = driver.DriverManager(
|
||||
"smaug.database.migration_backend",
|
||||
"karbor.database.migration_backend",
|
||||
cfg.CONF.database.backend).driver
|
||||
return _IMPL
|
||||
|
|
@ -35,15 +35,15 @@ from sqlalchemy.sql import expression
|
|||
from sqlalchemy.sql.expression import literal_column
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from smaug.db.sqlalchemy import models
|
||||
from smaug import exception
|
||||
from smaug.i18n import _, _LW
|
||||
from karbor.db.sqlalchemy import models
|
||||
from karbor import exception
|
||||
from karbor.i18n import _, _LW
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
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()
|
||||
_FACADE = None
|
||||
|
@ -1051,7 +1051,7 @@ def restore_destroy(context, restore_id):
|
|||
def is_valid_model_filters(model, filters):
|
||||
"""Return True if filter values exist on the model
|
||||
|
||||
:param model: a smaug model
|
||||
:param model: a karbor model
|
||||
:param filters: dictionary of filters
|
||||
"""
|
||||
for key in filters.keys():
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
import os
|
||||
|
||||
from smaug.db.sqlalchemy import migrate_repo
|
||||
from karbor.db.sqlalchemy import migrate_repo
|
||||
|
||||
from migrate.versioning.shell import main
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
[db_settings]
|
||||
# Used to identify which repository this database is versioned under.
|
||||
# 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.
|
||||
# This name shouldn't already be used by your project.
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""
|
||||
SQLAlchemy models for smaug data.
|
||||
SQLAlchemy models for karbor data.
|
||||
"""
|
||||
|
||||
from oslo_config import cfg
|
||||
|
@ -25,9 +25,9 @@ CONF = cfg.CONF
|
|||
BASE = declarative_base()
|
||||
|
||||
|
||||
class SmaugBase(models.TimestampMixin,
|
||||
models.ModelBase):
|
||||
"""Base class for Smaug Models."""
|
||||
class KarborBase(models.TimestampMixin,
|
||||
models.ModelBase):
|
||||
"""Base class for karbor Models."""
|
||||
|
||||
__table_args__ = {'mysql_engine': 'InnoDB'}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class SmaugBase(models.TimestampMixin,
|
|||
self.save(session=session)
|
||||
|
||||
|
||||
class Service(BASE, SmaugBase):
|
||||
class Service(BASE, KarborBase):
|
||||
"""Represents a running service on a host."""
|
||||
|
||||
__tablename__ = 'services'
|
||||
|
@ -54,7 +54,7 @@ class Service(BASE, SmaugBase):
|
|||
disabled = Column(Boolean, default=False)
|
||||
disabled_reason = Column(String(255))
|
||||
# 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
|
||||
# periodic updates
|
||||
modified_at = Column(DateTime)
|
||||
|
@ -62,7 +62,7 @@ class Service(BASE, SmaugBase):
|
|||
rpc_available_version = Column(String(36))
|
||||
|
||||
|
||||
class Trigger(BASE, SmaugBase):
|
||||
class Trigger(BASE, KarborBase):
|
||||
"""Represents a trigger."""
|
||||
|
||||
__tablename__ = 'triggers'
|
||||
|
@ -74,7 +74,7 @@ class Trigger(BASE, SmaugBase):
|
|||
properties = Column(Text, nullable=False)
|
||||
|
||||
|
||||
class ScheduledOperation(BASE, SmaugBase):
|
||||
class ScheduledOperation(BASE, KarborBase):
|
||||
"""Represents a scheduled operation."""
|
||||
|
||||
__tablename__ = 'scheduled_operations'
|
||||
|
@ -98,7 +98,7 @@ class ScheduledOperation(BASE, SmaugBase):
|
|||
'Trigger.deleted == 0)')
|
||||
|
||||
|
||||
class ScheduledOperationState(BASE, SmaugBase):
|
||||
class ScheduledOperationState(BASE, KarborBase):
|
||||
"""Represents a scheduled operation state."""
|
||||
|
||||
__tablename__ = 'scheduled_operation_states'
|
||||
|
@ -124,7 +124,7 @@ class ScheduledOperationState(BASE, SmaugBase):
|
|||
'ScheduledOperation.deleted == 0)')
|
||||
|
||||
|
||||
class ScheduledOperationLog(BASE, SmaugBase):
|
||||
class ScheduledOperationLog(BASE, KarborBase):
|
||||
"""Represents a scheduled operation log."""
|
||||
|
||||
__tablename__ = 'scheduled_operation_logs'
|
||||
|
@ -142,7 +142,7 @@ class ScheduledOperationLog(BASE, SmaugBase):
|
|||
extend_info = Column(Text)
|
||||
|
||||
|
||||
class Plan(BASE, SmaugBase):
|
||||
class Plan(BASE, KarborBase):
|
||||
"""Represents a Plan."""
|
||||
|
||||
__tablename__ = 'plans'
|
||||
|
@ -154,7 +154,7 @@ class Plan(BASE, SmaugBase):
|
|||
parameters = Column(Text)
|
||||
|
||||
|
||||
class Resource(BASE, SmaugBase):
|
||||
class Resource(BASE, KarborBase):
|
||||
"""Represents a resource in a plan."""
|
||||
|
||||
__tablename__ = 'resources'
|
||||
|
@ -170,7 +170,7 @@ class Resource(BASE, SmaugBase):
|
|||
'Resource.deleted == False)')
|
||||
|
||||
|
||||
class Restore(BASE, SmaugBase):
|
||||
class Restore(BASE, KarborBase):
|
||||
"""Represents a Restore."""
|
||||
|
||||
__tablename__ = 'restores'
|
||||
|
@ -183,7 +183,7 @@ class Restore(BASE, SmaugBase):
|
|||
status = Column(String(64))
|
||||
|
||||
|
||||
class OperationLog(BASE, SmaugBase):
|
||||
class OperationLog(BASE, KarborBase):
|
||||
"""Represents a operation log."""
|
||||
|
||||
__tablename__ = 'operation_logs'
|
||||
|
@ -200,7 +200,7 @@ class OperationLog(BASE, SmaugBase):
|
|||
def register_models():
|
||||
"""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
|
||||
connection is lost and needs to be reestablished.
|
||||
"""
|
|
@ -10,9 +10,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# 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.
|
||||
|
||||
|
@ -28,7 +28,7 @@ import webob.exc
|
|||
from webob.util import status_generic_reasons
|
||||
from webob.util import status_reasons
|
||||
|
||||
from smaug.i18n import _, _LE
|
||||
from karbor.i18n import _, _LE
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -69,8 +69,8 @@ class Error(Exception):
|
|||
pass
|
||||
|
||||
|
||||
class SmaugException(Exception):
|
||||
"""Base Smaug Exception
|
||||
class KarborException(Exception):
|
||||
"""Base karbor Exception
|
||||
|
||||
To correctly use this class, inherit from it and define
|
||||
a 'message' property. That message will get printf'd
|
||||
|
@ -83,16 +83,16 @@ class SmaugException(Exception):
|
|||
safe = False
|
||||
|
||||
def __init__(self, message=None, **kwargs):
|
||||
"""Initiate the instance of SmaugException
|
||||
"""Initiate the instance of KarborException
|
||||
|
||||
There are two ways to initiate the instance.
|
||||
1. Specify the value of 'message' and leave the 'kwargs' None.
|
||||
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
|
||||
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.
|
||||
"""
|
||||
self.kwargs = kwargs
|
||||
|
@ -126,13 +126,13 @@ class SmaugException(Exception):
|
|||
# it, because if we try to access the message via 'message' it will be
|
||||
# overshadowed by the class' message attribute
|
||||
self.msg = message
|
||||
super(SmaugException, self).__init__(message)
|
||||
super(KarborException, self).__init__(message)
|
||||
|
||||
def __unicode__(self):
|
||||
return six.text_type(self.msg)
|
||||
|
||||
|
||||
class NotAuthorized(SmaugException):
|
||||
class NotAuthorized(KarborException):
|
||||
message = _("Not authorized.")
|
||||
code = 403
|
||||
|
||||
|
@ -149,7 +149,7 @@ class AuthorizationFailure(NotAuthorized):
|
|||
message = _("Authorization for %(obj)s is failed ")
|
||||
|
||||
|
||||
class Invalid(SmaugException):
|
||||
class Invalid(KarborException):
|
||||
message = _("Unacceptable parameters.")
|
||||
code = 400
|
||||
|
||||
|
@ -162,7 +162,7 @@ class InvalidInput(Invalid):
|
|||
message = _("Invalid input received: %(reason)s")
|
||||
|
||||
|
||||
class NotFound(SmaugException):
|
||||
class NotFound(KarborException):
|
||||
message = _("Resource could not be found.")
|
||||
code = 404
|
||||
safe = True
|
||||
|
@ -172,7 +172,7 @@ class ConfigNotFound(NotFound):
|
|||
message = _("Could not find config at %(path)s")
|
||||
|
||||
|
||||
class MalformedRequestBody(SmaugException):
|
||||
class MalformedRequestBody(KarborException):
|
||||
message = _("Malformed message body: %(reason)s")
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ class ScheduledOperationLogNotFound(NotFound):
|
|||
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: "
|
||||
"%(reason)s")
|
||||
|
||||
|
@ -263,27 +263,27 @@ class ProviderNotFound(NotFound):
|
|||
" not be found.")
|
||||
|
||||
|
||||
class CreateBackupFailed(SmaugException):
|
||||
class CreateBackupFailed(KarborException):
|
||||
message = _("Create Backup failed: %(reason)s, id=%(resource_id)s,"
|
||||
" type=%(resource_type)s")
|
||||
|
||||
|
||||
class DeleteBackupFailed(SmaugException):
|
||||
class DeleteBackupFailed(KarborException):
|
||||
message = _("Delete Backup failed: %(reason)s, id=%(resource_id)s,"
|
||||
" type=%(resource_type)s")
|
||||
|
||||
|
||||
class RestoreBackupFailed(SmaugException):
|
||||
class RestoreBackupFailed(KarborException):
|
||||
message = _("Restore Backup failed: %(reason)s, id=%(resource_id)s,"
|
||||
" type=%(resource_type)s")
|
||||
|
||||
|
||||
class GetBackupFailed(SmaugException):
|
||||
class GetBackupFailed(KarborException):
|
||||
message = _("Get Backup failed: %(reason)s, id=%(resource_id)s,"
|
||||
" type=%(resource_type)s")
|
||||
|
||||
|
||||
class FlowError(SmaugException):
|
||||
class FlowError(KarborException):
|
||||
message = _("Flow: %(flow)s, Error: %(error)s")
|
||||
|
||||
|
||||
|
@ -292,35 +292,35 @@ class CheckpointNotFound(NotFound):
|
|||
" not be found.")
|
||||
|
||||
|
||||
class BankCreateObjectFailed(SmaugException):
|
||||
class BankCreateObjectFailed(KarborException):
|
||||
message = _("Create Object in Bank Failed: %(reason)s")
|
||||
|
||||
|
||||
class BankUpdateObjectFailed(SmaugException):
|
||||
class BankUpdateObjectFailed(KarborException):
|
||||
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")
|
||||
|
||||
|
||||
class BankGetObjectFailed(SmaugException):
|
||||
class BankGetObjectFailed(KarborException):
|
||||
message = _("Get Object %(key)s in Bank Failed: %(reason)s")
|
||||
|
||||
|
||||
class BankListObjectsFailed(SmaugException):
|
||||
class BankListObjectsFailed(KarborException):
|
||||
message = _("Get Object in Bank Failed: %(reason)s")
|
||||
|
||||
|
||||
class BankReadonlyViolation(SmaugException):
|
||||
class BankReadonlyViolation(KarborException):
|
||||
message = _("Bank read-only violation")
|
||||
|
||||
|
||||
class AcquireLeaseFailed(SmaugException):
|
||||
class AcquireLeaseFailed(KarborException):
|
||||
message = _("Acquire Lease in Failed: %(reason)s")
|
||||
|
||||
|
||||
class CreateContainerFailed(SmaugException):
|
||||
class CreateContainerFailed(KarborException):
|
||||
message = _("Create Container in Bank Failed: %(reason)s")
|
||||
|
||||
|
||||
|
@ -336,9 +336,9 @@ class InvalidOriginalId(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")
|
||||
|
||||
|
||||
class CheckpointNotBeDeleted(SmaugException):
|
||||
class CheckpointNotBeDeleted(KarborException):
|
||||
message = _("The checkpoint %(checkpoint_id)s can not be deleted.")
|
|
@ -18,7 +18,7 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html .
|
|||
|
||||
import oslo_i18n as i18n
|
||||
|
||||
DOMAIN = 'smaug'
|
||||
DOMAIN = 'karbor'
|
||||
|
||||
_translators = i18n.TranslatorFactory(domain=DOMAIN)
|
||||
|
|
@ -41,7 +41,7 @@ import sys
|
|||
|
||||
from oslo_utils import importutils
|
||||
|
||||
from smaug import exception
|
||||
from karbor import exception
|
||||
|
||||
|
||||
class BaseLoader(object):
|
|
@ -44,8 +44,8 @@ from oslo_log import log as logging
|
|||
import oslo_messaging as messaging
|
||||
from oslo_service import periodic_task
|
||||
|
||||
from smaug.db import base
|
||||
from smaug import version
|
||||
from karbor.db import base
|
||||
from karbor import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
|
@ -15,11 +15,11 @@ def register_all():
|
|||
# You must make sure your object gets imported in this
|
||||
# function in order for it to be registered by services that may
|
||||
# need to receive it via RPC.
|
||||
__import__('smaug.objects.service')
|
||||
__import__('smaug.objects.plan')
|
||||
__import__('smaug.objects.scheduled_operation')
|
||||
__import__('smaug.objects.trigger')
|
||||
__import__('smaug.objects.scheduled_operation_log')
|
||||
__import__('smaug.objects.scheduled_operation_state')
|
||||
__import__('smaug.objects.restore')
|
||||
__import__('smaug.objects.operation_log')
|
||||
__import__('karbor.objects.service')
|
||||
__import__('karbor.objects.plan')
|
||||
__import__('karbor.objects.scheduled_operation')
|
||||
__import__('karbor.objects.trigger')
|
||||
__import__('karbor.objects.scheduled_operation_log')
|
||||
__import__('karbor.objects.scheduled_operation_state')
|
||||
__import__('karbor.objects.restore')
|
||||
__import__('karbor.objects.operation_log')
|
|
@ -10,7 +10,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Smaug common internal object model"""
|
||||
"""karbor common internal object model"""
|
||||
|
||||
import contextlib
|
||||
import datetime
|
||||
|
@ -19,11 +19,11 @@ from oslo_log import log as logging
|
|||
from oslo_versionedobjects import base
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug.db.sqlalchemy import models
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from karbor import db
|
||||
from karbor.db.sqlalchemy import models
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
|
||||
|
||||
LOG = logging.getLogger('object')
|
||||
|
@ -32,7 +32,7 @@ remotable_classmethod = base.remotable_classmethod
|
|||
obj_make_list = base.obj_make_list
|
||||
|
||||
|
||||
class SmaugObjectRegistry(base.VersionedObjectRegistry):
|
||||
class KarborObjectRegistry(base.VersionedObjectRegistry):
|
||||
def registration_hook(self, cls, index):
|
||||
setattr(objects, cls.obj_name(), cls)
|
||||
# For Versioned Object Classes that have a model store the model in
|
||||
|
@ -44,11 +44,11 @@ class SmaugObjectRegistry(base.VersionedObjectRegistry):
|
|||
pass
|
||||
|
||||
|
||||
class SmaugObject(base.VersionedObject):
|
||||
OBJ_SERIAL_NAMESPACE = 'smaug_object'
|
||||
OBJ_PROJECT_NAMESPACE = 'smaug'
|
||||
class KarborObject(base.VersionedObject):
|
||||
OBJ_SERIAL_NAMESPACE = 'karbor_object'
|
||||
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.
|
||||
|
||||
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
|
||||
# in transition period. This override is to make these aliases pass
|
||||
# "'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)
|
||||
|
||||
|
||||
class SmaugObjectDictCompat(base.VersionedObjectDictCompat):
|
||||
class KarborObjectDictCompat(base.VersionedObjectDictCompat):
|
||||
"""Mix-in to provide dictionary key access compat.
|
||||
|
||||
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 future we'll remove this shim altogether so don't
|
||||
# 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',
|
||||
{'object_name': self.__class__.__name__,
|
||||
'attribute_name': key})
|
||||
|
@ -153,7 +153,7 @@ class SmaugObjectDictCompat(base.VersionedObjectDictCompat):
|
|||
return None
|
||||
|
||||
|
||||
class SmaugPersistentObject(object):
|
||||
class KarborPersistentObject(object):
|
||||
"""Mixin class for 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
|
||||
|
||||
|
||||
class SmaugComparableObject(base.ComparableVersionedObject):
|
||||
class KarborComparableObject(base.ComparableVersionedObject):
|
||||
def __eq__(self, obj):
|
||||
if hasattr(obj, 'obj_to_primitive'):
|
||||
return self.obj_to_primitive() == obj.obj_to_primitive()
|
||||
|
@ -199,8 +199,8 @@ class ObjectListBase(base.ObjectListBase):
|
|||
pass
|
||||
|
||||
|
||||
class SmaugObjectSerializer(base.VersionedObjectSerializer):
|
||||
OBJ_BASE_CLASS = SmaugObject
|
||||
class KarborObjectSerializer(base.VersionedObjectSerializer):
|
||||
OBJ_BASE_CLASS = KarborObject
|
||||
|
||||
|
||||
class DictOfDictOfStringsField(fields.AutoTypedField):
|
|
@ -14,20 +14,20 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class OperationLog(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class OperationLog(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -61,13 +61,13 @@ class OperationLog(base.SmaugPersistentObject, base.SmaugObject,
|
|||
if self.obj_attr_is_set('id'):
|
||||
raise exception.ObjectActionError(action='create',
|
||||
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)
|
||||
self._from_db_object(self._context, self, db_operation_log)
|
||||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates:
|
||||
db.operation_log_update(self._context, self.id, updates)
|
||||
self.obj_reset_changes()
|
||||
|
@ -78,8 +78,8 @@ class OperationLog(base.SmaugPersistentObject, base.SmaugObject,
|
|||
db.operation_log_destroy(self._context, self.id)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class OperationLogList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class OperationLogList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -15,20 +15,20 @@ from oslo_log import log as logging
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class Plan(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class Plan(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -107,7 +107,7 @@ class Plan(base.SmaugPersistentObject, base.SmaugObject,
|
|||
if self.obj_attr_is_set('id'):
|
||||
raise exception.ObjectActionError(action='create',
|
||||
reason=_('already created'))
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
|
||||
parameters = updates.pop('parameters', None)
|
||||
if parameters is not None:
|
||||
|
@ -121,7 +121,7 @@ class Plan(base.SmaugPersistentObject, base.SmaugObject,
|
|||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates:
|
||||
if 'parameters' in updates:
|
||||
parameters = updates.pop('parameters', None)
|
||||
|
@ -150,8 +150,8 @@ class Plan(base.SmaugPersistentObject, base.SmaugObject,
|
|||
db.plan_destroy(self._context, self.id)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class PlanList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class PlanList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -15,20 +15,20 @@ from oslo_log import log as logging
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class Restore(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class Restore(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -63,7 +63,7 @@ class Restore(base.SmaugPersistentObject, base.SmaugObject,
|
|||
if self.obj_attr_is_set('id'):
|
||||
raise exception.ObjectActionError(action='create',
|
||||
reason=_('already created'))
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
|
||||
parameters = updates.pop('parameters', None)
|
||||
if parameters is not None:
|
||||
|
@ -74,7 +74,7 @@ class Restore(base.SmaugPersistentObject, base.SmaugObject,
|
|||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates:
|
||||
db.restore_update(self._context, self.id, updates)
|
||||
self.obj_reset_changes()
|
||||
|
@ -85,8 +85,8 @@ class Restore(base.SmaugPersistentObject, base.SmaugObject,
|
|||
db.restore_destroy(self._context, self.id)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class RestoreList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class RestoreList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -15,20 +15,20 @@ from oslo_log import log as logging
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ScheduledOperation(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ScheduledOperation(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -94,14 +94,14 @@ class ScheduledOperation(base.SmaugPersistentObject, base.SmaugObject,
|
|||
raise exception.ObjectActionError(action='create',
|
||||
reason=_('already created'))
|
||||
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
self._convert_operation_definition_to_db_format(updates)
|
||||
db_op = db.scheduled_operation_create(self._context, updates)
|
||||
self._from_db_object(self._context, self, db_op)
|
||||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates and self.id:
|
||||
db.scheduled_operation_update(self._context,
|
||||
self.id,
|
||||
|
@ -114,8 +114,8 @@ class ScheduledOperation(base.SmaugPersistentObject, base.SmaugObject,
|
|||
db.scheduled_operation_delete(self._context, self.id)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ScheduledOperationList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ScheduledOperationList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -14,19 +14,19 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ScheduledOperationLog(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ScheduledOperationLog(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -62,13 +62,13 @@ class ScheduledOperationLog(base.SmaugPersistentObject, base.SmaugObject,
|
|||
raise exception.ObjectActionError(action='create',
|
||||
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)
|
||||
self._from_db_object(self._context, self, db_log)
|
||||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates and self.id is not None:
|
||||
db.scheduled_operation_log_update(self._context, self.id, updates)
|
||||
self.obj_reset_changes()
|
||||
|
@ -85,8 +85,8 @@ class ScheduledOperationLog(base.SmaugPersistentObject, base.SmaugObject,
|
|||
context, operation_id, retained_num, excepted_states)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ScheduledOperationLogList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ScheduledOperationLogList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -14,20 +14,20 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ScheduledOperationState(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ScheduledOperationState(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -81,13 +81,13 @@ class ScheduledOperationState(base.SmaugPersistentObject, base.SmaugObject,
|
|||
raise exception.ObjectActionError(action='create',
|
||||
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)
|
||||
self._from_db_object(self._context, self, db_state)
|
||||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates and self.operation_id:
|
||||
db.scheduled_operation_state_update(self._context,
|
||||
self.operation_id,
|
||||
|
@ -101,8 +101,8 @@ class ScheduledOperationState(base.SmaugPersistentObject, base.SmaugObject,
|
|||
self.operation_id)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ScheduledOperationStateList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ScheduledOperationStateList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -14,20 +14,20 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug import objects
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor import objects
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class Service(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class Service(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -73,13 +73,13 @@ class Service(base.SmaugPersistentObject, base.SmaugObject,
|
|||
if self.obj_attr_is_set('id'):
|
||||
raise exception.ObjectActionError(action='create',
|
||||
reason=_('already created'))
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
db_service = db.service_create(self._context, updates)
|
||||
self._from_db_object(self._context, self, db_service)
|
||||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates:
|
||||
db.service_update(self._context, self.id, updates)
|
||||
self.obj_reset_changes()
|
||||
|
@ -90,8 +90,8 @@ class Service(base.SmaugPersistentObject, base.SmaugObject,
|
|||
db.service_destroy(self._context, self.id)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class ServiceList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class ServiceList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -15,17 +15,17 @@ from oslo_log import log as logging
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_versionedobjects import fields
|
||||
|
||||
from smaug import db
|
||||
from smaug.objects import base
|
||||
from karbor import db
|
||||
from karbor.objects import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class Trigger(base.SmaugPersistentObject, base.SmaugObject,
|
||||
base.SmaugObjectDictCompat,
|
||||
base.SmaugComparableObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class Trigger(base.KarborPersistentObject, base.KarborObject,
|
||||
base.KarborObjectDictCompat,
|
||||
base.KarborComparableObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = '1.0'
|
||||
|
||||
|
@ -67,14 +67,14 @@ class Trigger(base.SmaugPersistentObject, base.SmaugObject,
|
|||
|
||||
@base.remotable
|
||||
def create(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
self._convert_properties_to_db_format(updates)
|
||||
db_trigger = db.trigger_create(self._context, updates)
|
||||
self._from_db_object(self._context, self, db_trigger)
|
||||
|
||||
@base.remotable
|
||||
def save(self):
|
||||
updates = self.smaug_obj_get_changes()
|
||||
updates = self.karbor_obj_get_changes()
|
||||
if updates and self.id:
|
||||
self._convert_properties_to_db_format(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)
|
||||
|
||||
|
||||
@base.SmaugObjectRegistry.register
|
||||
class TriggerList(base.ObjectListBase, base.SmaugObject):
|
||||
@base.KarborObjectRegistry.register
|
||||
class TriggerList(base.ObjectListBase, base.KarborObject):
|
||||
VERSION = '1.0'
|
||||
|
||||
fields = {
|
|
@ -13,14 +13,14 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Policy Engine For Smaug"""
|
||||
"""Policy Engine For karbor"""
|
||||
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_policy import opts as policy_opts
|
||||
from oslo_policy import policy
|
||||
|
||||
from smaug import exception
|
||||
from karbor import exception
|
||||
|
||||
CONF = cfg.CONF
|
||||
policy_opts.set_defaults(cfg.CONF, 'policy.json')
|
||||
|
@ -48,7 +48,7 @@ def enforce_action(context, action):
|
|||
def enforce(context, action, target):
|
||||
"""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
|
||||
this should be colon separated for clarity.
|
||||
i.e. ``compute:create_instance``,
|
|
@ -27,15 +27,15 @@ from oslo_config import cfg
|
|||
import oslo_messaging as messaging
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
import smaug.context
|
||||
import smaug.exception
|
||||
import karbor.context
|
||||
import karbor.exception
|
||||
|
||||
CONF = cfg.CONF
|
||||
TRANSPORT = None
|
||||
NOTIFIER = None
|
||||
|
||||
ALLOWED_EXMODS = [
|
||||
smaug.exception.__name__,
|
||||
karbor.exception.__name__,
|
||||
]
|
||||
EXTRA_EXMODS = []
|
||||
|
||||
|
@ -107,7 +107,7 @@ class RequestContextSerializer(messaging.Serializer):
|
|||
return _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):
|
|
@ -26,15 +26,15 @@ from oslo_service import loopingcall
|
|||
from oslo_service import service
|
||||
from oslo_utils import importutils
|
||||
|
||||
from smaug import context
|
||||
from smaug import db
|
||||
from smaug import exception
|
||||
from smaug.i18n import _, _LE, _LI, _LW
|
||||
from smaug.objects import base as objects_base
|
||||
from smaug import rpc
|
||||
from smaug import version
|
||||
from smaug.wsgi import common as wsgi_common
|
||||
from smaug.wsgi import eventlet_server as wsgi
|
||||
from karbor import context
|
||||
from karbor import db
|
||||
from karbor import exception
|
||||
from karbor.i18n import _, _LE, _LI, _LW
|
||||
from karbor.objects import base as objects_base
|
||||
from karbor import rpc
|
||||
from karbor import version
|
||||
from karbor.wsgi import common as wsgi_common
|
||||
from karbor.wsgi import eventlet_server as wsgi
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -51,14 +51,14 @@ service_opts = [
|
|||
help='Range, in seconds, to randomly delay when starting the'
|
||||
' periodic task OperationEngine to reduce stampeding.'
|
||||
' (Disable by setting to 0)'),
|
||||
cfg.StrOpt('osapi_smaug_listen',
|
||||
cfg.StrOpt('osapi_karbor_listen',
|
||||
default="0.0.0.0",
|
||||
help='IP address on which OpenStack Smaug API listens'),
|
||||
cfg.PortOpt('osapi_smaug_listen_port',
|
||||
help='IP address on which OpenStack Karbor API listens'),
|
||||
cfg.PortOpt('osapi_karbor_listen_port',
|
||||
default=8799,
|
||||
help='Port on which OpenStack Smaug API listens'),
|
||||
cfg.IntOpt('osapi_smaug_workers',
|
||||
help='Number of workers for OpenStack Smaug API service. '
|
||||
help='Port on which OpenStack Karbor API listens'),
|
||||
cfg.IntOpt('osapi_karbor_workers',
|
||||
help='Number of workers for OpenStack Karbor API service. '
|
||||
'The default is equal to the number of CPUs available.'), ]
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
@ -118,7 +118,7 @@ class Service(service.Service):
|
|||
target = messaging.Target(topic=self.topic, server=self.host)
|
||||
endpoints = [self.manager]
|
||||
endpoints.extend(self.manager.additional_endpoints)
|
||||
serializer = objects_base.SmaugObjectSerializer()
|
||||
serializer = objects_base.KarborObjectSerializer()
|
||||
self.rpcserver = rpc.get_server(target, endpoints, serializer)
|
||||
self.rpcserver.start()
|
||||
|
||||
|
@ -180,7 +180,7 @@ class Service(service.Service):
|
|||
|
||||
:param host: defaults to CONF.host
|
||||
: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 report_interval: defaults to CONF.report_interval
|
||||
:param periodic_interval: defaults to CONF.periodic_interval
|
||||
|
@ -194,7 +194,7 @@ class Service(service.Service):
|
|||
if not topic:
|
||||
topic = binary
|
||||
if not manager:
|
||||
subtopic = topic.rpartition('smaug-')[2]
|
||||
subtopic = topic.rpartition('karbor-')[2]
|
||||
manager = CONF.get('%s_manager' % subtopic, None)
|
||||
if report_interval is None:
|
||||
report_interval = CONF.report_interval
|
|
@ -16,8 +16,8 @@
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from smaug.db import base
|
||||
from smaug.services.operationengine import rpcapi as operationengine_rpcapi
|
||||
from karbor.db import base
|
||||
from karbor.services.operationengine import rpcapi as operationengine_rpcapi
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
|
@ -19,12 +19,12 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from smaug.common import constants
|
||||
from smaug import context
|
||||
from smaug.i18n import _LE, _LW
|
||||
from smaug import objects
|
||||
from smaug.services.operationengine.engine.executors import base
|
||||
from smaug.services.operationengine import operation_manager
|
||||
from karbor.common import constants
|
||||
from karbor import context
|
||||
from karbor.i18n import _LE, _LW
|
||||
from karbor import objects
|
||||
from karbor.services.operationengine.engine.executors import base
|
||||
from karbor.services.operationengine import operation_manager
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
|
@ -16,8 +16,8 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from threading import RLock
|
||||
|
||||
from smaug.i18n import _LE
|
||||
from smaug.services.operationengine.engine.executors import\
|
||||
from karbor.i18n import _LE
|
||||
from karbor.services.operationengine.engine.executors import\
|
||||
scheduled_operation_executor as base_executor
|
||||
|
||||
executor_opts = [
|
|
@ -15,9 +15,9 @@ Manage all triggers.
|
|||
"""
|
||||
from stevedore import driver as import_driver
|
||||
|
||||
from smaug import exception
|
||||
from smaug.i18n import _
|
||||
from smaug.services.operationengine.engine import triggers as all_triggers
|
||||
from karbor import exception
|
||||
from karbor.i18n import _
|
||||
from karbor.services.operationengine.engine import triggers as all_triggers
|
||||
|
||||
|
||||
class TriggerManager(object):
|
||||
|
@ -36,7 +36,7 @@ class TriggerManager(object):
|
|||
self._trigger_obj_map = {}
|
||||
|
||||
executor_cls = import_driver.DriverManager(
|
||||
'smaug.operationengine.engine.executor',
|
||||
'karbor.operationengine.engine.executor',
|
||||
'executor').driver
|
||||
self._executor = executor_cls()
|
||||
|