Class SharesAPI

    • Constructor Detail

      • SharesAPI

        public SharesAPI​(ApiClient apiClient)
        Regular-use constructor
      • SharesAPI

        public SharesAPI​(SharesService mock)
        Constructor for mocks
    • Method Detail

      • create

        public ShareInfo create​(CreateShare request)
        Create a share.

        Creates a new share for data objects. Data objects can be added after creation with **update**. The caller must be a metastore admin or have the **CREATE_SHARE** privilege on the metastore.

      • delete

        public void delete​(String name)
      • delete

        public void delete​(DeleteShareRequest request)
        Delete a share.

        Deletes a data object share from the metastore. The caller must be an owner of the share.

      • get

        public ShareInfo get​(GetShareRequest request)
        Get a share.

        Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the share.

      • list

        public Iterable<ShareInfo> list()
        List shares.

        Gets an array of data object shares from the metastore. The caller must be a metastore admin or the owner of the share. There is no guarantee of a specific ordering of the elements in the array.

      • sharePermissions

        public PermissionsList sharePermissions​(SharePermissionsRequest request)
        Get permissions.

        Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the owner of the share.

      • update

        public ShareInfo update​(UpdateShare request)
        Update a share.

        Updates the share with the changes and data objects in the request. The caller must be the owner of the share or a metastore admin.

        When the caller is a metastore admin, only the __owner__ field can be updated.

        In the case that the share name is changed, **updateShare** requires that the caller is both the share owner and a metastore admin.

        For each table that is added through this method, the share owner must also have **SELECT** privilege on the table. This privilege must be maintained indefinitely for recipients to be able to access the table. Typically, you should use a group as the share owner.

        Table removals through **update** do not require additional privileges.

      • updatePermissions

        public void updatePermissions​(String name)
      • updatePermissions

        public void updatePermissions​(UpdateSharePermissions request)
        Update permissions.

        Updates the permissions for a data share in the metastore. The caller must be a metastore admin or an owner of the share.

        For new recipient grants, the user must also be the owner of the recipients. recipient revocations do not require additional privileges.