Exemplo n.º 1
0
cst_ebs.service_code = 'AmazonEC2'
cst_ebs.tags = {
    'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Elastic-Block-Store-EBS.svg',
    'spaceone:display_name': 'EBS'
}
cst_ebs._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Volume ID', 'data.volume_id'),
        EnumDyField.data_source('State', 'data.state', default_state={
            'safe': ['in-use'],
            'available': ['available'],
            'warning': ['deleting', 'creating'],
            'disable': ['deleted'],
            'alert': ['error']
        }),
        SizeField.data_source('Size', 'instance_size'),
        TextDyField.data_source('Volume Type', 'instance_type'),
        TextDyField.data_source('IOPS', 'data.iops'),
        TextDyField.data_source('From Snapshot', 'data.snapshot_id'),
        TextDyField.data_source('Availablity Zone', 'data.availability_zone'),
        DateTimeDyField.data_source('Created', 'data.create_time'),
        TextDyField.data_source('ARN', 'data.arn', options={
            'is_optional': True
        }),
        TextDyField.data_source('Encrypted', 'data.encrypted', options={
            'is_optional': True
        }),
        TextDyField.data_source('KMS Key ID', 'data.kms_key_id', options={
            'is_optional': True
        }),
        TextDyField.data_source('Multi Attach Enabled', 'data.multi_attach_enabled', options={
cst_function.provider = 'aws'
cst_function.group = 'Lambda'
cst_function.labels = ['Compute']
cst_function.is_primary = True
cst_function.is_major = True
cst_function.service_code = 'AWSLambda'
cst_function.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/AWS-Lambda.svg',
}

cst_function._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        BadgeDyField.data_source('Runtime', 'data.runtime'),
        SizeField.data_source('Code Size', 'data.code_size'),
        SizeField.data_source('Memory Size',
                              'data.memory_size',
                              options={'source_unit': 'MB'}),
        TextDyField.data_source('Description', 'data.description'),
    ],
    search=[
        SearchField.set(name='Name', key='data.name'),
        SearchField.set(name='ARN', key='data.arn'),
        SearchField.set(name='Runtime', key='data.runtime'),
        SearchField.set(name='State',
                        key='data.state.type',
                        enums={
                            "Active": {
                                'label': 'Active',
                                'icon': {
Exemplo n.º 3
0
base = ItemDynamicLayout.set_fields(
    'File Systems',
    fields=[
        TextDyField.data_source('ID', 'data.file_system_id'),
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('File System State',
                                'data.life_cycle_state',
                                default_state={
                                    'safe': ['available'],
                                    'warning':
                                    ['creating', 'updating', 'deleting'],
                                    'disable': ['deleted']
                                }),
        TextDyField.data_source('Owner ID', 'data.owner_id'),
        SizeField.data_source('Metered Size', 'data.size_in_bytes.value'),
        TextDyField.data_source('Number of mount targets',
                                'data.number_of_mount_targets'),
        TextDyField.data_source('Performance mode', 'data.performance_mode'),
        TextDyField.data_source('Throughput mode', 'data.throughput_mode'),
        EnumDyField.data_source('Encrypted',
                                'data.encrypted',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                }),
        ListDyField.data_source('Lifecycle policy',
                                'data.life_cycle_policies',
                                options={
                                    'sub_key': 'transition_to_ia_display',
                                    'delimiter': '<br>'
cst_bucket.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-S3.svg',
}

cst_bucket._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Access',
                                'data.public_access',
                                default_badge={
                                    'indigo.500': ['Private'],
                                    'coral.600': ['Public']
                                }),
        TextDyField.data_source('Object Total Counts', 'data.object_count'),
        SizeField.data_source('Object Total Size', 'data.object_total_size'),
        TextDyField.data_source('ARN',
                                'data.arn',
                                options={'is_optional': True}),
        TextDyField.data_source('Versioning Status',
                                'data.versioning.status',
                                options={'is_optional': True}),
        TextDyField.data_source('Webhosting Index Document',
                                'data.website_hosting.index_document',
                                options={'is_optional': True}),
        TextDyField.data_source('Webhosting Error Document',
                                'data.website_hosting.error_document',
                                options={'is_optional': True}),
        TextDyField.data_source('Webhosting Error Document',
                                'data.website_hosting.routing_rules',
                                options={'is_optional': True}),
Exemplo n.º 5
0
     TextDyField.data_source('Total write capacity',
                             'data.total_write_capacity'),
     ListDyField.data_source('Auto Scaling',
                             'data.auto_scaling_policies',
                             default_badge={'type': 'outline'}),
     TextDyField.data_source('Table ID',
                             'data.table_id',
                             options={'is_optional': True}),
     TextDyField.data_source('ARN',
                             'data.table_arn',
                             options={'is_optional': True}),
     TextDyField.data_source('Encryption Type',
                             'data.encryption_type',
                             options={'is_optional': True}),
     SizeField.data_source('Table Size',
                           'data.table_size_bytes',
                           options={'is_optional': True}),
     TextDyField.data_source('Item Count',
                             'data.item_count',
                             options={'is_optional': True}),
     TextDyField.data_source('Time to Live Status',
                             'data.time_to_live.time_to_live_status',
                             options={'is_optional': True}),
     TextDyField.data_source('Billing Mode',
                             'data.billing_mode_summary.billing_mode',
                             options={'is_optional': True}),
     TextDyField.data_source('AWS Account ID',
                             'data.account_id',
                             options={'is_optional': True}),
 ],
 search=[
Exemplo n.º 6
0
            'Point-in-time Recovery',
            'data.continuous_backup.point_in_time_recovery_description.point_in_time_recovery_status',
            default_state={
                'safe': ['ENABLED'],
                'disable': ['DISABLED']
            }),
        EnumDyField.data_source(
            'CloudWatch Contributor Insights',
            'data.contributor_insight.contributor_insights_status',
            default_state={
                'safe': ['ENABLED'],
                'warninig': ['ENABLING', 'DISABLING'],
                'alert': ['FAILED'],
                'disable': ['DISABLED']
            }),
        SizeField.data_source('Storage Size', 'data.table_size_bytes'),
        TextDyField.data_source('Item count', 'data.item_count'),
        TextDyField.data_source('Region', 'data.region_name'),
        DateTimeDyField.data_source('Creation date',
                                    'data.creation_date_time'),
    ])

capacity = ItemDynamicLayout.set_fields(
    'Capacity',
    fields=[
        EnumDyField.data_source('Read/write capacity mode',
                                'data.billing_mode_summary.billing_mode',
                                default_badge={
                                    'indigo.500': ['PROVISIONED'],
                                    'coral.600': ['PAY_PER_REQUEST']
                                }),
Exemplo n.º 7
0
    'spaceone:display_name': 'EBS'
}
cst_ebs._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Volume ID', 'data.volume_id'),
        EnumDyField.data_source('State',
                                'data.state',
                                default_state={
                                    'safe': ['in-use'],
                                    'available': ['available'],
                                    'warning': ['deleting', 'creating'],
                                    'disable': ['deleted'],
                                    'alert': ['error']
                                }),
        SizeField.data_source('Size', 'data.size'),
        TextDyField.data_source('Volume Type', 'data.volume_type'),
        TextDyField.data_source('IOPS', 'data.iops'),
        TextDyField.data_source('From Snapshot', 'data.snapshot_id'),
        TextDyField.data_source('Availablity Zone', 'data.availability_zone'),
        DateTimeDyField.data_source('Created', 'data.create_time'),
        TextDyField.data_source('ARN',
                                'data.arn',
                                options={'is_optional': True}),
        TextDyField.data_source('Encrypted',
                                'data.encrypted',
                                options={'is_optional': True}),
        TextDyField.data_source('KMS Key ID',
                                'data.kms_key_id',
                                options={'is_optional': True}),
        TextDyField.data_source('Multi Attach Enabled',
Exemplo n.º 8
0
            'data.image_scanning_configuration.scan_on_push',
            default_badge={
                'indigo.500': ['true'],
                'coral.600': ['false']
            }),
    ])

images = TableDynamicLayout.set_fields(
    'Images',
    'data.images',
    fields=[
        ListDyField.data_source('Image Tag',
                                'image_tags_display',
                                options={'delimiter': ', '}),
        TextDyField.data_source('Image URI', 'image_uri'),
        SizeField.data_source('Image Size', 'image_size_in_bytes'),
        TextDyField.data_source('Digest', 'image_digest'),
        EnumDyField.data_source('Scan status',
                                'image_scan_status.status',
                                default_state={
                                    'safe': ['COMPLETE'],
                                    'warning': ['IN_PROGRESS'],
                                    'alert': ['FAILED']
                                }),
        DateTimeDyField.data_source('Pushed at', 'image_pushed_at'),
    ])

metadata = CloudServiceMeta.set_layouts(layouts=[base, images])


class ECRResource(CloudServiceResource):
cst_bucket.service_code = 'AmazonS3'
cst_bucket.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-S3.svg',
}

cst_bucket._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        EnumDyField.data_source('Access',
                                'data.public_access',
                                default_badge={
                                    'indigo.500': ['Private'],
                                    'coral.600': ['Public']
                                }),
        TextDyField.data_source('Object Total Counts', 'data.object_count'),
        SizeField.data_source('Object Total Size', 'instance_size'),
        TextDyField.data_source('ARN',
                                'data.arn',
                                options={'is_optional': True}),
        TextDyField.data_source('Versioning Status',
                                'data.versioning.status',
                                options={'is_optional': True}),
        TextDyField.data_source('Webhosting Index Document',
                                'data.website_hosting.index_document',
                                options={'is_optional': True}),
        TextDyField.data_source('Webhosting Error Document',
                                'data.website_hosting.error_document',
                                options={'is_optional': True}),
        TextDyField.data_source('Webhosting Error Document',
                                'data.website_hosting.routing_rules',
                                options={'is_optional': True}),
Exemplo n.º 10
0
cst_filesystem.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Elastic-File-System_EFS.svg'
}

cst_filesystem._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        EnumDyField.data_source('State',
                                'data.life_cycle_state',
                                default_state={
                                    'safe': ['available'],
                                    'warning':
                                    ['creating', 'updating', 'deleting'],
                                    'disable': ['deleted']
                                }),
        SizeField.data_source('Metered Sizes', 'instance_size'),
        TextDyField.data_source('Mount Targets',
                                'data.number_of_mount_targets'),
        TextDyField.data_source('ID',
                                'data.file_system_id',
                                options={'is_optional': True}),
        TextDyField.data_source('ARN',
                                'data.arn',
                                options={'is_optional': True}),
        TextDyField.data_source('Throughput Mode',
                                'data.throughput_mode',
                                options={'is_optional': True}),
        TextDyField.data_source('Performance Mode',
                                'data.performance_mode',
                                options={'is_optional': True}),
        TextDyField.data_source('Encrypted',
Exemplo n.º 11
0
                             'warning': ['creating', 'pending']
                         }),
 TextDyField.data_source('Cluster/Instance Name',
                         'data.db_instance_identifier'),
 EnumDyField.data_source('Type',
                         'data.snapshot_type',
                         default_outline_badge=['manual', 'automated']),
 EnumDyField.data_source('Storage Type',
                         'data.storage_type',
                         default_outline_badge=[
                             'standard', 'io1', 'gp2', 'gp3', 'st1',
                             'sc1'
                         ]),
 SizeField.data_source('Size',
                       'data.allocated_storage',
                       options={
                           'display_unit': 'GB',
                           'source_unit': 'GB'
                       }),
 EnumDyField.data_source('DB Engine',
                         'data.engine',
                         default_outline_badge=[
                             'aurora', 'aurora-mysql', 'docdb', 'mysql',
                             'mariadb', 'postgres', 'oracle-ee',
                             'oracle-se', 'oracle-se1', 'oracle-se2',
                             'sqlserver-ex', 'sqlserver-web',
                             'sqlserver-se', 'sqlserver-ee'
                         ]),
 TextDyField.data_source('DB Engine Version', 'data.engine_version'),
 TextDyField.data_source('Master username', 'data.master_username'),
 TextDyField.data_source('License Model', 'data.license_model'),
 TextDyField.data_source('Option Group', 'data.option_group_name'),
    ])

instance_hardware = TableDynamicLayout.set_fields(
    'Hardware',
    root_path='data.hardware',
    fields=[
        TextDyField.data_source('CPU Count', 'cpu_count'),
        ListDyField.data_source('Disks',
                                'disks',
                                default_badge={
                                    'type': 'outline',
                                    'sub_key': 'name'
                                }),
        SizeField.data_source('Ram',
                              'ram_size_in_gb',
                              options={
                                  'display_unit': 'GB',
                                  'source_unit': 'GB'
                              })
    ])

instance_networking = TableDynamicLayout.set_fields(
    'Networking',
    root_path='data.networking',
    fields=[
        TextDyField.data_source('Monthly Transfer',
                                'monthly_transfer.gb_per_month_allocated'),
        ListDyField.data_source('Ports',
                                'ports',
                                default_badge={
                                    'type': 'outline',
                                    'sub_key': 'common_name'
                         }),
 EnumDyField.data_source('Content Based Deduplication',
                         'data.content_based_duplication',
                         default_badge={
                             'indigo.500': ['true'],
                             'coral.600': ['false']
                         }),
 TextDyField.data_source('Approximate Number Of Messages',
                         'data.approximate_number_of_messages'),
 TextDyField.data_source('Approximate Number Of Messages Delayed',
                         'data.approximate_number_of_messages_delayed'),
 TextDyField.data_source(
     'Approximate Number Of Messages Not Visible',
     'data.approximate_number_of_messages_not_visible'),
 TextDyField.data_source('Delay Seconds', 'data.delay_seconds'),
 SizeField.data_source('Maximum Message Size',
                       'data.maximum_message_size'),
 TextDyField.data_source('Message Retention Period',
                         'data.message_retention_period'),
 TextDyField.data_source('Receive Message Wait Time Seconds',
                         'data.receive_message_wait_time_seconds'),
 TextDyField.data_source('Visibility Timeout',
                         'data.visibility_timeout'),
 DateTimeDyField.data_source('Created Time',
                             'data.created_timestamp',
                             options={
                                 'source_type': 'timestamp',
                                 'source_format': 'seconds'
                             }),
 DateTimeDyField.data_source('Last Modified Time',
                             'data.last_modified_timestamp',
                             options={