MCPcopy Create free account
hub / github.com/aws/aws-cli / _build_sdk_metadata

Method _build_sdk_metadata

awscli/botocore/useragent.py:422–458  ·  view source on GitHub ↗

Build the SDK name and version component of the User-Agent header. For backwards-compatibility both session-level and client-level config of custom tool names are honored. If this removes the Botocore information from the start of the string, Botocore's name and ver

(self)

Source from the content-addressed store, hash-verified

420 )
421
422 def _build_sdk_metadata(self):
423 """
424 Build the SDK name and version component of the User-Agent header.
425
426 For backwards-compatibility both session-level and client-level config
427 of custom tool names are honored. If this removes the Botocore
428 information from the start of the string, Botocore's name and version
429 are included as a separate field with "md" prefix.
430 """
431 sdk_md = []
432 if (
433 self._session_user_agent_name
434 and self._session_user_agent_version
435 and (
436 self._session_user_agent_name != _USERAGENT_SDK_NAME
437 or self._session_user_agent_version != botocore_version
438 )
439 ):
440 sdk_md.extend(
441 [
442 UserAgentComponent(
443 self._session_user_agent_name,
444 self._session_user_agent_version,
445 ),
446 ]
447 )
448 else:
449 sdk_md.append(
450 UserAgentComponent(_USERAGENT_SDK_NAME, botocore_version)
451 )
452
453 if self._crt_version is not None:
454 sdk_md.append(
455 UserAgentComponent('md', 'awscrt', self._crt_version)
456 )
457
458 return sdk_md
459
460 def _build_os_metadata(self):
461 """

Callers 1

to_stringMethod · 0.95

Calls 1

UserAgentComponentClass · 0.85

Tested by

no test coverage detected