Hello community,

here is the log from the commit of package python3-susepubliccloudinfo for 
openSUSE:Factory checked in at 2020-09-12 00:07:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-susepubliccloudinfo (Old)
 and      /work/SRC/openSUSE:Factory/.python3-susepubliccloudinfo.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-susepubliccloudinfo"

Sat Sep 12 00:07:19 2020 rev:6 rq:833335 version:1.2.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python3-susepubliccloudinfo/python3-susepubliccloudinfo.changes
  2019-08-13 13:17:34.665473588 +0200
+++ 
/work/SRC/openSUSE:Factory/.python3-susepubliccloudinfo.new.4249/python3-susepubliccloudinfo.changes
        2020-09-12 00:07:29.412925789 +0200
@@ -1,0 +2,6 @@
+Wed Sep  2 18:40:38 UTC 2020 - Robert Schweikert <[email protected]>
+
+- Update to version 1.2.2 (bsc#1176102, bsc#1176103)
+  + Support query for providers/frameworks, regions, and image states
+
+-------------------------------------------------------------------

Old:
----
  susepubliccloudinfo-1.2.1.tar.bz2

New:
----
  susepubliccloudinfo-1.2.2.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-susepubliccloudinfo.spec ++++++
--- /var/tmp/diff_new_pack.CLv35C/_old  2020-09-12 00:07:31.164927464 +0200
+++ /var/tmp/diff_new_pack.CLv35C/_new  2020-09-12 00:07:31.164927464 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-susepubliccloudinfo
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,12 +18,12 @@
 
 %define upstream_name susepubliccloudinfo
 Name:           python3-susepubliccloudinfo
-Version:        1.2.1
+Version:        1.2.2
 Release:        0
 Summary:        Query SUSE Public Cloud Info Service
 License:        GPL-3.0-or-later
 Group:          System/Management
-Url:            https://github.com/SUSE-Enceladus/public-cloud-info-client
+URL:            https://github.com/SUSE-Enceladus/public-cloud-info-client
 Source0:        %{upstream_name}-%{version}.tar.bz2
 Requires:       python3
 Requires:       python3-docopt

++++++ susepubliccloudinfo-1.2.1.tar.bz2 -> susepubliccloudinfo-1.2.2.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/susepubliccloudinfo-1.2.1/bin/pint 
new/susepubliccloudinfo-1.2.2/bin/pint
--- old/susepubliccloudinfo-1.2.1/bin/pint      2019-08-02 23:37:13.693820539 
+0200
+++ new/susepubliccloudinfo-1.2.2/bin/pint      2020-09-02 20:33:15.749634594 
+0200
@@ -20,12 +20,21 @@
 #
 """
 usage: pint -h | --help
-       pint (amazon|google|microsoft) servers
+       pint providers
+          [ --json | --xml ]
+       pint image_states
+          [ --json | --xml ]
+       pint ({PROVIDERS}) server_types 
+          [ --json | --xml ]
+       pint ({PROVIDERS}) regions
+          [ --filter=<filter> ]
+          [ --json | --xml ]
+       pint ({PROVIDERS}) servers
           [ --filter=<filter> ]
           [ --json | --xml ]
           [ --region=<region> ]
           [ --smt | --regionserver ]
-       pint (amazon|google|microsoft|oracle) images
+       pint ({PROVIDERS}) images
           [ --active | --inactive | --deleted | --deprecated ]
           [ --filter=<filter> ]
           [ --json | --xml ]
@@ -63,16 +72,22 @@
 """
 
 import sys
+import json
 
 from docopt import docopt
 
 import susepubliccloudinfoclient.infoserverrequests as ifsrequest
 import susepubliccloudinfoclient.version as version
 
-command_args = docopt(__doc__, version=version.VERSION)
+provider_data = ifsrequest.get_provider_data(None, None, 'json', 'all', None)
+providers = json.loads(provider_data)
+cloud_providers = []
+for provider in providers['providers']:
+    cloud_providers.append(provider['name'])
+
+command_args = docopt(__doc__.format(PROVIDERS = "|".join(cloud_providers)), 
version=version.VERSION)
 
 framework = None
-cloud_providers = ['amazon', 'google', 'microsoft', 'oracle']
 for csp in cloud_providers:
     if command_args[csp]:
         framework = csp
@@ -111,11 +126,39 @@
             output_format,
             region,
             command_args['--filter']))
-    else:
+    elif command_args['servers']:
         print(ifsrequest.get_server_data(
             framework,
             server_type,
             output_format,
+            region,
+            command_args['--filter']))
+    elif command_args['providers']:
+        print(ifsrequest.get_provider_data(
+            framework,
+            server_type,
+            output_format,
+            region,
+            command_args['--filter']))
+    elif command_args['image_states']:
+        print(ifsrequest.get_image_states_data(
+            framework,
+            server_type,
+            output_format,
+            region,
+            command_args['--filter']))
+    elif command_args['server_types']:
+        print(ifsrequest.get_server_types_data(
+            framework,
+            server_type,
+            output_format,
+            region,
+            command_args['--filter']))
+    else:
+        print(ifsrequest.get_regions_data(
+            framework,
+            server_type,
+            output_format,
             region,
             command_args['--filter']))
 except Exception:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/PKG-INFO 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/PKG-INFO
--- old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/PKG-INFO     
2019-08-02 23:37:13.693820539 +0200
+++ new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/PKG-INFO     
1970-01-01 01:00:00.000000000 +0100
@@ -1,35 +0,0 @@
-Metadata-Version: 2.1
-Name: susepubliccloudinfo
-Version: 1.0.4
-Summary: Command-line tool to access SUSE Public Cloud Information Service
-Home-page: https://github.com/SUSE-Enceladus/public-cloud-info-client
-Author: SUSE Public Cloud Team
-Author-email: [email protected]
-License: GPL-3.0+
-Description: [![Build 
Status](https://travis-ci.com/SUSE-Enceladus/public-cloud-info-client.svg?branch=master)](https://travis-ci.com/SUSE-Enceladus/public-cloud-info-client)
-        
-        pint
-        ====
-        
-        pint (Public Cloud INformation Tracker) is a command line client to 
access
-        the REST API provided by the SUSE Public Cloud Information Service. The
-        information service provides data about the images SUSE publishes in 
various
-        public cloud frameworks (Amazon, Google, Microsoft) as well as the
-        servers that make up the SUSE maintained and operated update 
infrastructure
-        in those frameworks.
-        
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: Natural Language :: English
-Classifier: License :: OSI Approved :: GNU General Public License v3 or later 
(GPLv3+)
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: Implementation :: CPython
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Description-Content-Type: text/markdown
-Provides-Extra: dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/SOURCES.txt 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/SOURCES.txt
--- old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/SOURCES.txt  
2019-08-02 23:37:13.693820539 +0200
+++ new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/SOURCES.txt  
1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-LICENSE
-MANIFEST.in
-README.md
-setup.cfg
-bin/pint
-lib/susepubliccloudinfo.egg-info/PKG-INFO
-lib/susepubliccloudinfo.egg-info/SOURCES.txt
-lib/susepubliccloudinfo.egg-info/dependency_links.txt
-lib/susepubliccloudinfo.egg-info/requires.txt
-lib/susepubliccloudinfo.egg-info/top_level.txt
-lib/susepubliccloudinfoclient/__init__.py
-lib/susepubliccloudinfoclient/infoserverrequests.py
-lib/susepubliccloudinfoclient/version.py
-man/man1/pint.1
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/dependency_links.txt
 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/dependency_links.txt
--- 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/dependency_links.txt
 2019-08-02 23:37:13.693820539 +0200
+++ 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/dependency_links.txt
 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/requires.txt 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/requires.txt
--- old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/requires.txt 
2019-08-02 23:37:13.693820539 +0200
+++ new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/requires.txt 
1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-docopt
-lxml
-requests
-
-[dev]
-coverage
-pycodestyle
-nose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/top_level.txt 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/top_level.txt
--- 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfo.egg-info/top_level.txt    
    2019-08-02 23:37:13.693820539 +0200
+++ 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfo.egg-info/top_level.txt    
    1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-susepubliccloudinfoclient
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfoclient/infoserverrequests.py
 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfoclient/infoserverrequests.py
--- 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfoclient/infoserverrequests.py
   2019-08-02 23:37:13.693820539 +0200
+++ 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfoclient/infoserverrequests.py
   2020-09-02 20:33:15.749634594 +0200
@@ -151,12 +151,18 @@
     url_components = []
     url_components.append(__get_base_url())
     url_components.append(__get_api_version())
-    url_components.append(framework)
+    if framework:
+        url_components.append(framework)
     if region == 'all':
         region = None
     if region:
         url_components.append(urllib.parse.quote(region))
-    url_components.append(info_type)
+    if info_type == 'states':
+        url_components.append('images/states')
+    elif info_type == 'types':
+        url_components.append('servers/types')
+    else:
+        url_components.append(info_type)
     doc_type = image_state or server_type
     if doc_type:
         url_components.append(doc_type)
@@ -202,7 +208,11 @@
 
 
 def __inflect(plural):
-    inflections = {'images': 'image', 'servers': 'server'}
+    inflections = {
+        'images': 'image', 'servers': 'server',
+        'providers': 'provider', 'states': 'state', 'types': 'type',
+        'regions': 'region'
+    }
     return inflections[plural]
 
 
@@ -293,6 +303,82 @@
     return __reformat(resultset, info_type, result_format)
 
 
+def get_provider_data(
+        framework,
+        type,
+        result_format='plain',
+        region='all',
+        command_arg_filter=None):
+    """Return the requested providers information"""
+    info_type = 'providers'
+    url = __form_url(
+        framework,
+        info_type,
+        result_format,
+        region,
+        type,
+        apply_filters=command_arg_filter
+    )
+    return __process(url, info_type, command_arg_filter, result_format)
+
+
+def get_image_states_data(
+        framework,
+        type,
+        result_format='plain',
+        region='all',
+        command_arg_filter=None):
+    """Return the requested image states information"""
+    info_type = 'states'
+    url = __form_url(
+        framework,
+        info_type,
+        result_format,
+        region,
+        type,
+        apply_filters=command_arg_filter
+    )
+    return __process(url, info_type, command_arg_filter, result_format)
+
+
+def get_server_types_data(
+        framework,
+        type,
+        result_format='plain',
+        region='all',
+        command_arg_filter=None):
+    """Return the requested server types information"""
+    info_type = 'types'
+    url = __form_url(
+        framework,
+        info_type,
+        result_format,
+        region,
+        type,
+        apply_filters=command_arg_filter
+    )
+    return __process(url, info_type, command_arg_filter, result_format)
+
+
+def get_regions_data(
+        framework,
+        type,
+        result_format='plain',
+        region='all',
+        command_arg_filter=None):
+    """Return the requested regions information"""
+    info_type = 'regions'
+    url = __form_url(
+        framework,
+        info_type,
+        result_format,
+        region,
+        type,
+        apply_filters=command_arg_filter
+    )
+    return __process(url, info_type, command_arg_filter, result_format)
+
+
 def get_image_data(
         framework,
         image_state,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfoclient/version.py 
new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfoclient/version.py
--- old/susepubliccloudinfo-1.2.1/lib/susepubliccloudinfoclient/version.py      
2019-08-02 23:37:13.693820539 +0200
+++ new/susepubliccloudinfo-1.2.2/lib/susepubliccloudinfoclient/version.py      
2020-09-02 20:33:15.749634594 +0200
@@ -17,4 +17,4 @@
 # along with susePublicCloudInfoClient. If not, see
 # <http://www.gnu.org/licenses/>.
 #
-VERSION = '1.2.1'
+VERSION = '1.2.2'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/susepubliccloudinfo-1.2.1/man/man1/pint.1 
new/susepubliccloudinfo-1.2.2/man/man1/pint.1
--- old/susepubliccloudinfo-1.2.1/man/man1/pint.1       2019-08-02 
23:37:13.693820539 +0200
+++ new/susepubliccloudinfo-1.2.2/man/man1/pint.1       2020-09-02 
20:33:15.749634594 +0200
@@ -5,7 +5,13 @@
 .SH NAME
 pint \- Public-cloud INformation Tracker
 .SH SYNOPSIS
-.B pint amazon|google|microsoft|oracle images|servers [options]
+.B pint providers [options]
+
+.B pint image_states [options]
+
+.B pint 
+.I provider
+.B server_types|regions|images|servers [options]
 .SH DESCRIPTION
 .B pint
 A client for the SUSE Public Cloud Information service at
@@ -13,9 +19,11 @@
 The SUSE Public Cloud Information service provides information about
 the SUSE maintained and operated update infrastructure as well as the SUSE
 published guest images in Public Cloud provider frameworks.
+It also provides the generic metadata information like the list of available 
+providers, image states, server types and regions.
 .P
-The information service provides a REST API using the general format as
-follows:
+The information service provides a REST API which flows from generic to 
+to specific using the general format as follows:
 .IP https://susepubliccloudinfo.suse.com/v1/
 .IP <framework>
 .IP [<region>]/
@@ -23,6 +31,14 @@
 .IP <data-target>.<format>
 .P
 For example:
+.IP https://susepubliccloudinfo.suse.com/v1/providers.json
+Provides list of all providers in JSON format.
+.IP https://susepubliccloudinfo.suse.com/v1/images/states.json
+Provides list of all image states in JSON format.
+.IP https://susepubliccloudinfo.suse.com/v1/amazon/servers/types.json
+Provides list of all server types in Amazon Web Service EC2 in JSON format.
+.IP https://susepubliccloudinfo.suse.com/v1/amazon/regions.json
+Provides list of all known regions in Amazon Web Service EC2 in JSON format.
 .IP https://susepubliccloudinfo.suse.com/v1/amazon/servers.json
 Provides information about all servers part of the SUSE update infrastructure
 in Amazon Web Services EC2 in JSON format.


Reply via email to