23
23
24
24
HEADER_NAME_USER_AGENT = 'User-Agent'
25
25
SDK_NAME = 'ibm-cos-resource-config-python-sdk'
26
- """
27
- This file is auto-generated using the sdk-generation tool.
28
- The generated SDK_NAME value was ibm-cos-sdk-python-config because it was picked up from the SDK repo.
29
26
30
- We have manually edited the SDK_NAME to be ibm-cos-resource-config-python-sdk.
31
- Ensure that we don't touch this value if we decide to run the sdk-generation tool again in the future.
32
- """
33
27
34
28
def get_system_info ():
35
29
"""
36
30
Get information about the system to be inserted into the User-Agent header.
37
31
"""
38
- return 'lang={0}; arch={1}; os={2}; python.version={3}' .format ('python' ,
39
- platform .machine (), # Architecture
40
- platform .system (), # OS
41
- platform .python_version ()) # Python version
32
+ return 'lang={0}; arch={1}; os={2}; python.version={3}' .format (
33
+ 'python' , platform .machine (), platform .system (), platform .python_version () # Architecture # OS
34
+ ) # Python version
42
35
43
36
44
37
def get_user_agent ():
@@ -52,18 +45,18 @@ def get_user_agent():
52
45
53
46
54
47
def get_sdk_headers (service_name , service_version , operation_id ):
55
- #pylint: disable=unused-argument
48
+ # pylint: disable=unused-argument
56
49
"""
57
50
Get the request headers to be sent in requests by the SDK.
58
51
59
52
If you plan to gather metrics for your SDK, the User-Agent header value must
60
53
be a string similar to the following:
61
- ibm-cos-resource-config-python-sdk/2.0.0 (lang=python; arch=x86_64; os=Linux; python.version=3.7.4)
54
+ ibm-cos-resource-config-python-sdk/2.0.1 (lang=python; arch=x86_64; os=Linux; python.version=3.7.4)
62
55
63
56
In the example above, the analytics tool will parse the user-agent header and
64
57
use the following properties:
65
58
"ibm-cos-resource-config-python-sdk" - the name of your sdk
66
- "2.0.0 "- the version of your sdk
59
+ "2.0.1 "- the version of your sdk
67
60
"lang=python" - the language of the current sdk
68
61
"arch=x86_64; os=Linux; python.version=3.7.4" - system information
69
62
0 commit comments