root / snf-astakos-app / astakos / im / management / commands / component-list.py @ def409e0
History | View | Annotate | Download (2.1 kB)
1 | 252eef38 | Giorgos Korfiatis | # Copyright 2012, 2013 GRNET S.A. All rights reserved.
|
---|---|---|---|
2 | 252eef38 | Giorgos Korfiatis | #
|
3 | 252eef38 | Giorgos Korfiatis | # Redistribution and use in source and binary forms, with or
|
4 | 252eef38 | Giorgos Korfiatis | # without modification, are permitted provided that the following
|
5 | 252eef38 | Giorgos Korfiatis | # conditions are met:
|
6 | 252eef38 | Giorgos Korfiatis | #
|
7 | 252eef38 | Giorgos Korfiatis | # 1. Redistributions of source code must retain the above
|
8 | 252eef38 | Giorgos Korfiatis | # copyright notice, this list of conditions and the following
|
9 | 252eef38 | Giorgos Korfiatis | # disclaimer.
|
10 | 252eef38 | Giorgos Korfiatis | #
|
11 | 252eef38 | Giorgos Korfiatis | # 2. Redistributions in binary form must reproduce the above
|
12 | 252eef38 | Giorgos Korfiatis | # copyright notice, this list of conditions and the following
|
13 | 252eef38 | Giorgos Korfiatis | # disclaimer in the documentation and/or other materials
|
14 | 252eef38 | Giorgos Korfiatis | # provided with the distribution.
|
15 | 252eef38 | Giorgos Korfiatis | #
|
16 | 252eef38 | Giorgos Korfiatis | # THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
17 | 252eef38 | Giorgos Korfiatis | # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 | 252eef38 | Giorgos Korfiatis | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19 | 252eef38 | Giorgos Korfiatis | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
20 | 252eef38 | Giorgos Korfiatis | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21 | 252eef38 | Giorgos Korfiatis | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 | 252eef38 | Giorgos Korfiatis | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
23 | 252eef38 | Giorgos Korfiatis | # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
24 | 252eef38 | Giorgos Korfiatis | # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
25 | 252eef38 | Giorgos Korfiatis | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
26 | 252eef38 | Giorgos Korfiatis | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 | 252eef38 | Giorgos Korfiatis | # POSSIBILITY OF SUCH DAMAGE.
|
28 | 252eef38 | Giorgos Korfiatis | #
|
29 | 252eef38 | Giorgos Korfiatis | # The views and conclusions contained in the software and
|
30 | 252eef38 | Giorgos Korfiatis | # documentation are those of the authors and should not be
|
31 | 252eef38 | Giorgos Korfiatis | # interpreted as representing official policies, either expressed
|
32 | 252eef38 | Giorgos Korfiatis | # or implied, of GRNET S.A.
|
33 | 252eef38 | Giorgos Korfiatis | |
34 | 252eef38 | Giorgos Korfiatis | from astakos.im.models import Component |
35 | 7cfc0cef | Christos Stavrakakis | from snf_django.management.commands import ListCommand |
36 | 252eef38 | Giorgos Korfiatis | |
37 | 252eef38 | Giorgos Korfiatis | |
38 | 252eef38 | Giorgos Korfiatis | class Command(ListCommand): |
39 | 252eef38 | Giorgos Korfiatis | help = "List components"
|
40 | 252eef38 | Giorgos Korfiatis | object_class = Component |
41 | 252eef38 | Giorgos Korfiatis | |
42 | 252eef38 | Giorgos Korfiatis | FIELDS = { |
43 | 252eef38 | Giorgos Korfiatis | "id": ("id", "Component ID"), |
44 | 252eef38 | Giorgos Korfiatis | "name": ("name", "Component Name"), |
45 | f98e9f6f | Giorgos Korfiatis | "base_url": ("base_url", "Component base URL"), |
46 | f98e9f6f | Giorgos Korfiatis | "ui_url": ("url", "Component UI URL"), |
47 | 252eef38 | Giorgos Korfiatis | "token": ("auth_token", "Authentication token"), |
48 | f98e9f6f | Giorgos Korfiatis | "token_created": ("auth_token_created", "Token creation date"), |
49 | 252eef38 | Giorgos Korfiatis | } |
50 | 252eef38 | Giorgos Korfiatis | |
51 | f98e9f6f | Giorgos Korfiatis | fields = ["id", "name", "base_url"] |