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

Function get_skill_download

awscli/customizations/agenttoolkit/utils.py:81–103  ·  view source on GitHub ↗

Download a skill zip and its checksum via the modeled API. Returns (zip_bytes, checksum_hex, resolved_version).

(client, skill_name, version=None)

Source from the content-addressed store, hash-verified

79
80
81def get_skill_download(client, skill_name, version=None):
82 """
83 Download a skill zip and its checksum via the modeled API.
84
85 Returns (zip_bytes, checksum_hex, resolved_version).
86 """
87
88 # Actually look up the latest version instead of just passing 'latest',
89 # this lets us write out the new version to the metadata file without
90 # inspecting the zip contents
91 if version is None:
92 version = resolve_latest_version(client, skill_name)
93
94 response = client.get_skill_file(
95 name=skill_name, skillVersion=version, filePath='download'
96 )
97 zip_bytes = response['body'].read()
98
99 response = client.get_skill_file_checksum(
100 name=skill_name, skillVersion=version, filePath='download'
101 )
102 checksum = response['body'].strip().lower().split()[0]
103 return zip_bytes, checksum, version
104
105
106def read_installed_version(skill_dir):

Callers 3

_run_mainMethod · 0.90
_run_mainMethod · 0.90

Calls 2

resolve_latest_versionFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected