How to use the boto3.resources.base.ServiceResource function in boto3

To help you get started, we’ve selected a few boto3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alliefitter / boto3_type_annotations / boto3_type_annotations_with_docs / boto3_type_annotations / cloudwatch / service_resource.py View on Github external
:returns: A Metric resource
        """
        pass

    def get_available_subresources(self) -> List[str]:
        """
        Returns a list of all the available sub-resources for this
        Resource.
        :returns: A list containing the name of each sub-resource for this
            resource
        :rtype: list of str
        """
        pass


class Alarm(base.ServiceResource):
    alarm_name: str
    alarm_arn: str
    alarm_description: str
    alarm_configuration_updated_timestamp: datetime
    actions_enabled: bool
    ok_actions: List
    alarm_actions: List
    insufficient_data_actions: List
    state_value: str
    state_reason: str
    state_reason_data: str
    state_updated_timestamp: datetime
    metric_name: str
    namespace: str
    statistic: str
    extended_statistic: str
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / s3 / service_resource.py View on Github external
pass

    def get_available_subresources(self) -> List[str]:
        pass

    def load(self):
        pass

    def put(self, CORSConfiguration: Dict):
        pass

    def reload(self):
        pass


class BucketLifecycle(base.ServiceResource):
    rules: List
    bucket_name: str

    def delete(self):
        pass

    def get_available_subresources(self) -> List[str]:
        pass

    def load(self):
        pass

    def put(self, LifecycleConfiguration: Dict = None):
        pass

    def reload(self):
github alliefitter / boto3_type_annotations / boto3_type_annotations_with_docs / boto3_type_annotations / glacier / service_resource.py View on Github external
:returns: Vault resource
        """
        pass

    def get_available_subresources(self) -> List[str]:
        """
        Returns a list of all the available sub-resources for this
        Resource.
        :returns: A list containing the name of each sub-resource for this
            resource
        :rtype: list of str
        """
        pass


class Archive(base.ServiceResource):
    account_id: str
    vault_name: str
    id: str

    def delete(self):
        """
        This operation deletes an archive from a vault. Subsequent requests to initiate a retrieval of this archive will fail. Archive retrievals that are in progress for this archive ID may or may not succeed according to the following scenarios:
        * If the archive retrieval job is actively preparing the data for download when Amazon Glacier receives the delete archive request, the archival retrieval operation might fail. 
        * If the archive retrieval job has successfully prepared the archive for download when Amazon Glacier receives the delete archive request, you will be able to download the output. 
        This operation is idempotent. Attempting to delete an already-deleted archive does not result in an error.
        An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see `Access Control Using AWS Identity and Access Management (IAM) `__ .
        For conceptual information and underlying REST API, see `Deleting an Archive in Amazon Glacier `__ and `Delete Archive `__ in the *Amazon Glacier Developer Guide* . 
        See also: `AWS API Documentation `_
        
        **Request Syntax**
        ::
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / cloudformation / service_resource.py View on Github external
pass

    def get_available_subresources(self) -> List[str]:
        pass

    def load(self):
        pass

    def reload(self):
        pass

    def update(self, TemplateBody: str = None, TemplateURL: str = None, UsePreviousTemplate: bool = None, StackPolicyDuringUpdateBody: str = None, StackPolicyDuringUpdateURL: str = None, Parameters: List = None, Capabilities: List = None, ResourceTypes: List = None, RoleARN: str = None, RollbackConfiguration: Dict = None, StackPolicyBody: str = None, StackPolicyURL: str = None, NotificationARNs: List = None, Tags: List = None, ClientRequestToken: str = None) -> Dict:
        pass


class StackResource(base.ServiceResource):
    stack_id: str
    logical_resource_id: str
    physical_resource_id: str
    resource_type: str
    last_updated_timestamp: datetime
    resource_status: str
    resource_status_reason: str
    description: str
    metadata: str
    drift_information: Dict
    stack_name: str
    logical_id: str

    def get_available_subresources(self) -> List[str]:
        pass
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / ec2 / service_resource.py View on Github external
value: str

    def delete(self, DryRun: bool = None):
        pass

    def get_available_subresources(self) -> List[str]:
        pass

    def load(self):
        pass

    def reload(self):
        pass


class Volume(base.ServiceResource):
    attachments: List
    availability_zone: str
    create_time: datetime
    encrypted: bool
    kms_key_id: str
    size: int
    snapshot_id: str
    state: str
    volume_id: str
    iops: int
    tags: List
    volume_type: str
    id: str
    snapshots: 'snapshots'

    def attach_to_instance(self, Device: str, InstanceId: str, DryRun: bool = None) -> Dict:
github mozilla-services / autopush / autopush / db.py View on Github external
from autopush.utils import (
    generate_hash,
    normalize_id,
    WebPushNotification,
)

if TYPE_CHECKING:  # pragma: nocover
    from autopush.config import AutopushConfig, DDBTableConfig  # noqa


# Max DynamoDB record lifespan (~ 30 days)
MAX_EXPIRY = 2592000  # pragma: nocover

# Typing
T = TypeVar('T')  # noqa
TableFunc = Callable[[str, int, int, ServiceResource], Any]

key_hash = ""
TRACK_DB_CALLS = False
DB_CALLS = []

MAX_DDB_SESSIONS = constants.THREAD_POOL_SIZE


def get_month(delta=0):
    # type: (int) -> datetime.date
    """Basic helper function to get a datetime.date object iterations months
    ahead/behind of now.

    """
    new = last = datetime.date.today()
    # Move until we hit a new month, this avoids having to manually
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / iam / service_resource.py View on Github external
pass

    def detach_user(self, UserName: str):
        pass

    def get_available_subresources(self) -> List[str]:
        pass

    def load(self):
        pass

    def reload(self):
        pass


class PolicyVersion(base.ServiceResource):
    document: str
    is_default_version: bool
    create_date: datetime
    arn: str
    version_id: str

    def delete(self):
        pass

    def get_available_subresources(self) -> List[str]:
        pass

    def load(self):
        pass

    def reload(self):
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / glacier / service_resource.py View on Github external
pass

    def Notification(self, account_id: str = None, vault_name: str = None) -> 'Notification':
        pass

    def Vault(self, account_id: str = None, name: str = None) -> 'Vault':
        pass

    def create_vault(self, vaultName: str) -> 'Vault':
        pass

    def get_available_subresources(self) -> List[str]:
        pass


class Account(base.ServiceResource):
    id: str
    vaults: 'vaults'

    def create_vault(self, vaultName: str) -> 'Vault':
        pass

    def get_available_subresources(self) -> List[str]:
        pass


class Archive(base.ServiceResource):
    account_id: str
    vault_name: str
    id: str

    def delete(self):
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / iam / service_resource.py View on Github external
from boto3.resources.collection import ResourceCollection
from typing import Union
from typing import List
from typing import Optional
from typing import Dict
from datetime import datetime
from boto3.resources import base


class ServiceResource(base.ServiceResource):
    groups: 'groups'
    instance_profiles: 'instance_profiles'
    policies: 'policies'
    roles: 'roles'
    saml_providers: 'saml_providers'
    server_certificates: 'server_certificates'
    users: 'users'
    virtual_mfa_devices: 'virtual_mfa_devices'

    def AccessKey(self, user_name: str = None, id: str = None) -> 'AccessKey':
        pass

    def AccessKeyPair(self, user_name: str = None, id: str = None, secret: str = None) -> 'AccessKeyPair':
        pass

    def AccountPasswordPolicy(self) -> 'AccountPasswordPolicy':
github alliefitter / boto3_type_annotations / boto3_type_annotations / boto3_type_annotations / ec2 / service_resource.py View on Github external
state: str
    vpc_peering_connection_id: str
    route_table_id: str
    destination_cidr_block: str

    def delete(self, DestinationIpv6CidrBlock: str = None, DryRun: bool = None):
        pass

    def get_available_subresources(self) -> List[str]:
        pass

    def replace(self, DestinationIpv6CidrBlock: str = None, DryRun: bool = None, EgressOnlyInternetGatewayId: str = None, GatewayId: str = None, InstanceId: str = None, NatGatewayId: str = None, TransitGatewayId: str = None, NetworkInterfaceId: str = None, VpcPeeringConnectionId: str = None):
        pass


class RouteTable(base.ServiceResource):
    associations_attribute: List
    propagating_vgws: List
    route_table_id: str
    routes_attribute: List
    tags: List
    vpc_id: str
    owner_id: str
    id: str

    def associate_with_subnet(self, SubnetId: str, DryRun: bool = None) -> 'RouteTableAssociation':
        pass

    def create_route(self, DestinationCidrBlock: str = None, DestinationIpv6CidrBlock: str = None, DryRun: bool = None, EgressOnlyInternetGatewayId: str = None, GatewayId: str = None, InstanceId: str = None, NatGatewayId: str = None, TransitGatewayId: str = None, NetworkInterfaceId: str = None, VpcPeeringConnectionId: str = None) -> 'Route':
        pass

    def create_tags(self, Tags: List, DryRun: bool = None) -> List['Tag']: