Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rtveitch committed Jul 16, 2019
1 parent c03ae96 commit 5f86011
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 787 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

# 1.1.0
## Content
### Features
* Activity Tracker

# 1.0.1
## Content
### Defect Fixes
Expand Down
2 changes: 1 addition & 1 deletion cos_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__author__ = 'IBM'
__version__ = '1.0.2.dev1'
__version__ = '1.1.0'
69 changes: 69 additions & 0 deletions cos_config/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

# coding: utf-8

# Copyright 2019 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import platform
from .__init__ import __version__

SDK_ANALYTICS_HEADER = 'X-IBMCloud-SDK-Analytics'
USER_AGENT_HEADER = 'User-Agent'
SDK_NAME = 'ibm-cos-resource-config-sdk-python/' + __version__

def get_system_info():
"""
return system information
:return:
"""
return '{0} {1} {2}'.format(# OS
platform.system(),
# OS version
platform.release(),
# Python version
platform.python_version())

def get_user_agent():
"""
return user agent
:return:
"""
return user_agent

def get_sdk_analytics(service_name, service_version, operation_id):
"""
return analytics
:param service_name:
:param service_version:
:param operation_id:
:return:
"""
return 'service_name={0};service_version={1};operation_id={2}'.format(
service_name, service_version, operation_id)

user_agent = '{0}-{1} {2}'.format(SDK_NAME, __version__, get_system_info())

def get_sdk_headers(service_name, service_version, operation_id):
"""
return headers
:param service_name:
:param service_version:
:param operation_id:
:return:
"""
headers = {}
headers[SDK_ANALYTICS_HEADER] = get_sdk_analytics(service_name, service_version, operation_id)
headers[USER_AGENT_HEADER] = get_user_agent()
return headers
154 changes: 0 additions & 154 deletions cos_config/iam_token_manager.py

This file was deleted.

Loading

0 comments on commit 5f86011

Please sign in to comment.