Skip to content

Comments

[Container Registry] Update API for Beta 2#18392

Merged
37 commits merged intoAzure:masterfrom
seankane-msft:acr-container-repo
May 7, 2021
Merged

[Container Registry] Update API for Beta 2#18392
37 commits merged intoAzure:masterfrom
seankane-msft:acr-container-repo

Conversation

@seankane-msft
Copy link
Contributor

No description provided.

from ._models import ContentProperties


class ContainerRepository(ContainerRegistryBaseClient):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this no longer a client? Is it because a user cannot instantiate it themselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A user could instantiate it themselves but it would look a little awkward. We received feedback from the service team that the two clients made it confusing on where a user should start. Krystof and Anne Thompson came up with a design where both ContainerRepository and RegistryArtifact have client-like properties (being able to make service calls) but are more like models. This produces a more intuitive starting point with ContainerRegistryClient.



class RegistryArtifactOrderBy(str, Enum):
class ManifestOrderBy(str, Enum):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this should just be called ManifestOrder or ManifestOrdering.
Then it reads better: order_by=ManifestOrder.LAST_UPDATE_TIME_DESCENDING

# type: (str, str, TokenCredential, Dict[str, Any]) -> None
"""Create a ContainerRepositoryClient from an endpoint, repository name, and credential
class RegistryArtifact(ContainerRegistryBaseClient):
def __init__(self, endpoint, repository, tag_or_digest, credential, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is also kind of a client - but it didn't have the pipeline/transport wrapping in the methods that construct it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reasoning is the same as for ContainerRegistry, but I do need to add the pipeline/transport wrapping constructs.

@Azure Azure deleted a comment from check-enforcer bot May 6, 2021
@seankane-msft seankane-msft added this to the [2021] May milestone May 6, 2021
@seankane-msft seankane-msft requested a review from annatisch May 6, 2021 16:08

@distributed_trace
def list_manifests(self, **kwargs):
# type: (Dict[str, Any]) -> ItemPaged[ArtifactManifestProperties]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the listed items here the same data that I would get from a get_manifest_properties call?
We're using the same response object for both - so just checking that they both include the same information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are, both calls return the same data.

:paramtype last: str
:keyword order_by: Query parameter for ordering by time ascending or descending
:paramtype order_by: :class:`~azure.containerregistry.TagOrderBy`
:paramtype order_by: :class:`~azure.containerregistry.TagOrder`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The param documentation should include str as a valid input where ever we also use enums :)
Though it doesn't need to be fixed for this preview.

"ContainerRepository",
"ContentProperties",
"ManifestOrderBy",
"DeleteRepositoryResult",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What information do we get back from a delete operation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manifests and tags deleted as part of the repository delete operation

:vartype last_updated_on: :class:`datetime.datetime`
:ivar int manifest_count: Number of manifest in the repository
:ivar str name: Name of the repository
:ivar str registry: Registry the repository belongs to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't think this would be useful info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an error on my part, the registry is not included in the response object.

if not endpoint.startswith("https://") and not endpoint.startswith("http://"):
endpoint = "https://" + endpoint
self._endpoint = endpoint
self.name = name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also have something like the property on RegistryArtifact:

self.fully_qualified_name = self._endpoint + self.repository

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes adding it now.

@ghost
Copy link

ghost commented May 7, 2021

Hello @seankane-msft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@Azure Azure deleted a comment from check-enforcer bot May 7, 2021
@ghost ghost merged commit 9fba82f into Azure:master May 7, 2021
@seankane-msft seankane-msft deleted the acr-container-repo branch May 7, 2021 22:16
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request May 7, 2021
…into azure_purview_scanning

* 'master' of https://github.com/Azure/azure-sdk-for-python: (31 commits)
  [purview] add catalog client (Azure#17788)
  Add spellcheck for modified files (Azure#18496)
  [Container Registry] Update API for Beta 2 (Azure#18392)
  First version of Confidential Ledger Python SDK (Azure#17951)
  [llc] add quickstart (Azure#18537)
  [Storage][Fix]Copy source is redirecting (Azure#18577)
  [Tables] pre-release script (Azure#18505)
  Update changelogs (Azure#18575)
  [formrecognizer] Adding to_dict() on custom models (Azure#18402)
  Raise CredentialUnavailableError when CLI subprocess times out (Azure#18509)
  Extend Check Enforcer timeout (Azure#18526)
  Core raw streaming (Azure#17920)
  hide secrets in mgmt sdk (Azure#18535)
  add filter samples for list methods (Azure#18480)
  Revert changes to SetDevVersion. (Azure#18555)
  add support for filtering/paging/sorting options for "list_**" methods (Azure#18302)
  [Tables] Misc client updates (Azure#18462)
  [EventHub&ServiceBus] Prepare for release (Azure#18527)
  [Communication]: Updated communication connection strings to be consistent across packages and languages (Azure#18519)
  [AppConfig] Fixing samples (Azure#18542)
  ...
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request May 7, 2021
…into agrifood_nspkg

* 'master' of https://github.com/Azure/azure-sdk-for-python: (31 commits)
  [purview] add catalog client (Azure#17788)
  Add spellcheck for modified files (Azure#18496)
  [Container Registry] Update API for Beta 2 (Azure#18392)
  First version of Confidential Ledger Python SDK (Azure#17951)
  [llc] add quickstart (Azure#18537)
  [Storage][Fix]Copy source is redirecting (Azure#18577)
  [Tables] pre-release script (Azure#18505)
  Update changelogs (Azure#18575)
  [formrecognizer] Adding to_dict() on custom models (Azure#18402)
  Raise CredentialUnavailableError when CLI subprocess times out (Azure#18509)
  Extend Check Enforcer timeout (Azure#18526)
  Core raw streaming (Azure#17920)
  hide secrets in mgmt sdk (Azure#18535)
  add filter samples for list methods (Azure#18480)
  Revert changes to SetDevVersion. (Azure#18555)
  add support for filtering/paging/sorting options for "list_**" methods (Azure#18302)
  [Tables] Misc client updates (Azure#18462)
  [EventHub&ServiceBus] Prepare for release (Azure#18527)
  [Communication]: Updated communication connection strings to be consistent across packages and languages (Azure#18519)
  [AppConfig] Fixing samples (Azure#18542)
  ...
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize on repositoryName parameter in ContainerRegistryClient methods

2 participants