-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scanning): Add list all image tags method (#191)
- Loading branch information
1 parent
1a933a8
commit c554f9f
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
|
||
from expects import expect, contain, have_keys | ||
from mamba import before, description, it | ||
|
||
from sdcclient import SdScanningClient | ||
from specs import be_successful_api_call | ||
|
||
with description("Scanning list_image_tags") as self: | ||
with before.all: | ||
self.client = SdScanningClient(sdc_url=os.getenv("SDC_SECURE_URL", "https://secure.sysdig.com"), | ||
token=os.getenv("SDC_SECURE_TOKEN")) | ||
|
||
with it("is able to retrieve all the image tags"): | ||
ok, res = self.client.list_image_tags() | ||
|
||
expect((ok, res)).to(be_successful_api_call) | ||
expect(res).to( | ||
contain(have_keys("analyzed_at", "created_at", "fulltag", "imageDigest", "imageId", "parentDigest", | ||
"tag_detected_at", "analysis_status"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
from expects import expect, contain, have_keys | ||
from mamba import before, description, it | ||
|
||
from sdcclient import SdScanningClient | ||
from specs import be_successful_api_call | ||
|
||
with description("Scanning list_images") as self: | ||
with before.all: | ||
self.client = SdScanningClient(sdc_url=os.getenv("SDC_SECURE_URL", "https://secure.sysdig.com"), | ||
token=os.getenv("SDC_SECURE_TOKEN")) | ||
with it("is able to list all the scanned images"): | ||
ok, res = self.client.list_images() | ||
|
||
expect((ok, res)).to(be_successful_api_call) | ||
expect(res).to(contain( | ||
have_keys("annotations", "imageDigest", "last_updated", "analysis_status", "image_content", "image_detail", | ||
"image_status", "parentDigest", "userId", "created_at"))) |