Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
4421ebfc
Commit
4421ebfc
authored
Nov 05, 2013
by
Giorgos Korfiatis
Committed by
Christos Stavrakakis
Nov 22, 2013
Browse files
Remove resource import/export commands
They have been subsumed by the respective service import/export commands.
parent
ed060feb
Changes
5
Hide whitespace changes
Inline
Side-by-side
docs/admin-guide.rst
View file @
4421ebfc
...
...
@@ -920,10 +920,9 @@ project-list List projects
project-show Show project details
quota List and check the integrity of user quota
reconcile-resources-astakos Reconcile resource usage of Quotaholder with Astakos DB
resource-export-astakos Export astakos resources in json format
resource-import Register resources
resource-list List resources
resource-modify Modify a resource's default base quota and boolean flags
service-export-astakos Export Astakos services and resources in JSON format
service-import Register services
service-list List services
service-show Show service details
...
...
@@ -949,7 +948,7 @@ Pithos snf-manage commands
Name Description
============================ ===========================
reconcile-commissions-pithos Display unresolved commissions and trigger their recovery
resour
ce-export-pithos Export
p
ithos resources in
json
format
servi
ce-export-pithos
Export
P
ithos
services and
resources in
JSON
format
reconcile-resources-pithos Detect unsynchronized usage between Astakos and Pithos DB resources and synchronize them if specified so.
============================ ===========================
...
...
@@ -996,8 +995,7 @@ floating-ip-list List floating IPs
floating-ip-remove Delete a floating IP
queue-inspect Inspect the messages of a RabbitMQ queue
queue-retry Resend messages from Dead Letter queues to original exchanges
resource-export-cyclades Export Cyclades resources in JSON format.
service-export-cyclades Export Cyclades services in JSON format.
service-export-cyclades Export Cyclades services and resources in JSON format
subnet-create Create a subnet
subnet-inspect Inspect a subnet in DB
subnet-list List subnets
...
...
snf-astakos-app/astakos/im/management/commands/resource-export-astakos.py
deleted
100644 → 0
View file @
ed060feb
# Copyright 2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from
django.utils
import
simplejson
as
json
from
django.core.management.base
import
BaseCommand
from
astakos.im.astakos_resources
import
resources
class
Command
(
BaseCommand
):
help
=
"Export astakos resources in json format"
def
handle
(
self
,
*
args
,
**
options
):
output
=
json
.
dumps
(
resources
,
indent
=
4
)
self
.
stdout
.
write
(
output
+
'
\n
'
)
snf-astakos-app/astakos/im/management/commands/resource-import.py
deleted
100644 → 0
View file @
ed060feb
# Copyright 2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from
optparse
import
make_option
from
django.db
import
transaction
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.utils
import
simplejson
as
json
from
astakos.im.register
import
add_resource
,
RegisterException
from
._common
import
read_from_file
class
Command
(
BaseCommand
):
help
=
"Register resources"
option_list
=
BaseCommand
.
option_list
+
(
make_option
(
'--json'
,
dest
=
'json'
,
metavar
=
'<json.file>'
,
help
=
"Load resource definitions from a json file"
),
)
def
handle
(
self
,
*
args
,
**
options
):
json_file
=
options
[
'json'
]
if
not
json_file
:
m
=
"Expecting option --json."
raise
CommandError
(
m
)
else
:
data
=
read_from_file
(
json_file
)
m
=
'Input should be a JSON list.'
try
:
data
=
json
.
loads
(
data
)
except
json
.
JSONDecodeError
:
raise
CommandError
(
m
)
if
not
isinstance
(
data
,
list
):
raise
CommandError
(
m
)
self
.
add_resources
(
data
)
@
transaction
.
commit_on_success
def
add_resources
(
self
,
resources
):
output
=
[]
for
resource
in
resources
:
if
not
isinstance
(
resource
,
dict
):
raise
CommandError
(
"Malformed resource dict."
)
try
:
r
,
exists
=
add_resource
(
resource
)
except
RegisterException
as
e
:
raise
CommandError
(
e
.
message
)
name
=
r
.
name
if
exists
:
m
=
"Resource '%s' updated in database.
\n
"
%
(
name
)
else
:
m
=
(
"Resource '%s' created in database with default "
"quota limit 0.
\n
"
%
(
name
))
output
.
append
(
m
)
for
line
in
output
:
self
.
stdout
.
write
(
line
)
snf-cyclades-app/synnefo/quotas/management/commands/resource-export-cyclades.py
deleted
100644 → 0
View file @
ed060feb
# Copyright 2012-2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from
django.utils
import
simplejson
as
json
from
django.core.management.base
import
NoArgsCommand
from
synnefo.quotas
import
resources
class
Command
(
NoArgsCommand
):
help
=
"Export Cyclades resources in JSON format."
def
handle
(
self
,
*
args
,
**
options
):
output
=
json
.
dumps
(
resources
.
resources
,
indent
=
4
)
self
.
stdout
.
write
(
output
+
"
\n
"
)
snf-pithos-app/pithos/api/management/commands/resource-export-pithos.py
deleted
100644 → 0
View file @
ed060feb
# Copyright 2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from
django.utils
import
simplejson
as
json
from
django.core.management.base
import
BaseCommand
from
pithos.api
import
resources
class
Command
(
BaseCommand
):
help
=
"Export pithos resources in json format"
def
handle
(
self
,
*
args
,
**
options
):
output
=
json
.
dumps
(
resources
.
resources
,
indent
=
4
)
self
.
stdout
.
write
(
output
+
'
\n
'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment