Ejemplo n.º 1
0
                                '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={
                                        'source_type': 'timestamp',
                                        'source_format': 'seconds'
                                    }),
    ])

metadata = CloudServiceMeta.set_layouts(layouts=[sqs])


class SQSResource(CloudServiceResource):
    cloud_service_group = StringType(default='SQS')


class QueResource(SQSResource):
    cloud_service_type = StringType(default='Queue')
    data = ModelType(QueData)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class SQSResponse(CloudServiceResponse):
Ejemplo n.º 2
0
scheduled_action = TableDynamicLayout.set_fields(
    'Scheduled Actions',
    'data.scheduled_actions',
    fields=[
        TextDyField.data_source('Action name', 'scheduled_action_name'),
        TextDyField.data_source('Description', 'scheduled_action_description'),
        TextDyField.data_source('Schedule', 'schedule'),
        EnumDyField.data_source('State',
                                'state',
                                default_state={'safe': ['available']}),
        TextDyField.data_source('IAM Role', 'iam_role'),
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(layouts=[
    base, db_conf, net_sec, param_group, nodes, snapshots, snpashot_schedule,
    scheduled_action, tags
])


class RedshiftResource(CloudServiceResource):
    cloud_service_group = StringType(default='Redshift')


class ClusterResource(RedshiftResource):
    cloud_service_type = StringType(default='RedshiftCluster')
    data = ModelType(Cluster)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')

Ejemplo n.º 3
0
        TextDyField.data_source('Origin Group ID', 'id'),
        ListDyField.data_source('Origins',
                                'members.items',
                                options={
                                    'sub_key': 'origin_id',
                                    'delimiter': '<br>'
                                }),
        ListDyField.data_source('Failover criteria',
                                'failover_criteria.status_codes.items',
                                options={
                                    'delimiter': '<br>',
                                })
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(
    [meta_base, alias_icp_recordals, origin, origin_group, tags])


class CloudFrontResource(CloudServiceResource):
    cloud_service_group = StringType(default='CloudFront')


class DistributionResource(CloudFrontResource):
    cloud_service_type = StringType(default='Distribution')
    data = ModelType(DistributionData)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class CloudFrontResponse(CloudServiceResponse):
Ejemplo n.º 4
0
])

group_policy_table = TableDynamicLayout.set_fields('Permissions', root_path='data.attached_permission', fields=[
    TextDyField.data_source('Policy Name', 'policy_name'),
    TextDyField.data_source('Policy ID', 'policy_id'),
    EnumDyField.data_source('Policy Type', 'policy_type', default_badge={
        'indigo.500': ['AWS Managed'], 'coral.600': ['Local Managed'],
    }),
    TextDyField.data_source('Policy ARN', 'arn'),
    TextDyField.data_source('Permission Usage Count', 'attachment_count'),
    TextDyField.data_source('Description', 'description'),
    DateTimeDyField.data_source('Created At', 'create_date'),
    DateTimeDyField.data_source('Updated At', 'update_date'),
])

group_metadata = CloudServiceMeta.set_layouts(layouts=[group_base, group_user_table, group_policy_table])

# USER
user_base = ItemDynamicLayout.set_fields('User', fields=[
    TextDyField.data_source('User Name', 'data.user_name'),
    TextDyField.data_source('User ID', 'data.user_id'),
    TextDyField.data_source('User ARN', 'data.arn'),
    TextDyField.data_source('Path', 'data.path'),
    TextDyField.data_source('groups', 'data.groups_display'),
    TextDyField.data_source('Access Key Age', 'data.access_key_age_display'),
    TextDyField.data_source('Last Activity', 'data.last_activity'),
    EnumDyField.data_source('MFA', 'data.mfa_device', default_badge={
        'indigo.500': ['Virtual'], 'coral.600': ['Not enabled'],
    }),
    DateTimeDyField.data_source('Created At', 'data.create_date'),
    DateTimeDyField.data_source('Last Accessed At', 'data.password_last_used'),
Ejemplo n.º 5
0
    fields=[
        EnumDyField.data_source('Protocol',
                                'protocol_display',
                                default_badge={
                                    'coral.600': ['ALL'],
                                    'indigo.500': ['TCP'],
                                    'peacock.500': ['UDP'],
                                    'green.500': ['ICMP']
                                }),
        TextDyField.data_source('Port range', 'port_display'),
        TextDyField.data_source('Source', 'source_display'),
        TextDyField.data_source('Description', 'description_display'),
    ])

sg_tags = SimpleTableDynamicLayout.set_tags()
sg_metadata = CloudServiceMeta.set_layouts(
    layouts=[sg, inbound_rules, outbound_rules, sg_tags])

ami = ItemDynamicLayout.set_fields(
    'AMI',
    fields=[
        TextDyField.data_source('AMI ID', 'data.image_id'),
        TextDyField.data_source('AMI Name', 'data.name'),
        TextDyField.data_source('Owner', 'data.owner_id'),
        TextDyField.data_source('Source', 'data.image_location'),
        EnumDyField.data_source(
            'Status',
            'data.state',
            default_state={
                'safe': ['available'],
                'warning': ['pending', 'transient', 'deregistered', 'invalid'],
                'alert': ['error', 'failed']
Ejemplo n.º 6
0
rest_api_meta_base = ItemDynamicLayout.set_fields('REST API', fields=[
    TextDyField.data_source('Id', 'data.id'),
    TextDyField.data_source('Name', 'data.name'),
    TextDyField.data_source('Description', 'data.description'),
    ListDyField.data_source('Endpoint Type', 'data.endpoint_configuration.types', default_badge={'type': 'outline'})
])

# TAB - RESOURCE
rest_api_meta_resources = TableDynamicLayout.set_fields('Resources', 'data.resources', fields=[
    TextDyField.data_source('ID', 'id'),
    TextDyField.data_source('Parent ID', 'parent_id'),
    TextDyField.data_source('Path', 'path'),
    ListDyField.data_source('HTTP Methods', 'display_methods', default_badge={'type': 'inline'}),
])

rest_api_meta = CloudServiceMeta.set_layouts([rest_api_meta_base,
                                              rest_api_meta_resources])


'''
WEBSOCKET & HTTP
'''
# TAB - BASE
websocket_meta_base = ItemDynamicLayout.set_fields('HTTP & Web Socket', fields=[
    TextDyField.data_source('Id', 'data.api_id'),
    TextDyField.data_source('Name', 'data.name'),
    TextDyField.data_source('Endpoint', 'data.api_endpoint'),
    TextDyField.data_source('Description', 'data.description'),
    BadgeDyField.data_source('Protocol Type', 'data.protocol_type'),
])

websocket_meta = CloudServiceMeta.set_layouts([websocket_meta_base, ])
Ejemplo n.º 7
0
        EnumDyField.data_source(
            'Status',
            'data.contributor_insight.contributor_insights_status',
            default_state={
                'safe': ['ENABLED'],
                'warning': ['ENABLING', 'DISABLING'],
                'disable': ['DISABLED'],
                'alert': ['FAILED']
            }),
        ListDyField.data_source(
            'Rule List',
            'data.contributor_insight.contributor_insights_rule_list',
            default_badge={'type': 'outline'}),
    ])

metadata = CloudServiceMeta.set_layouts(
    layouts=[tables, capacity, encryption, ttl, contributor_insights])


class DynamoDBResource(CloudServiceResource):
    cloud_service_group = StringType(default='DynamoDB')


class TableResource(DynamoDBResource):
    cloud_service_type = StringType(default='Table')
    data = ModelType(Table)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class TableResponse(CloudServiceResponse):
Ejemplo n.º 8
0
#     TextDyField.data_source('DomainName', 'domain_name'),
#     TextDyField.data_source('OriginPath', 'origin_path'),
# ]
# origin_groups = TableDynamicView({'name': 'Origin Groups', 'key_path': 'data.distribution_config.origin_groups.items'})
# origin_groups.data_source = [
#     TextDyField.data_source('Id', 'id'),
#     ListDyField.data_source('Members', 'members.items',
#                             view_option=ListViewOption({
#                                 'item': TextDyField(),
#                                 'sub_key': 'cname',
#                             })),
# ]
#
# metadata.sub_data = [origins, origin_groups]

meta = CloudServiceMeta.set()


class CloudFrontResource(CloudServiceResource):
    cloud_service_group = StringType(default='CloudFront')


class DistributionResource(CloudFrontResource):
    cloud_service_type = StringType(default='Distribution')
    data = ModelType(DistributionData)
    cloud_service_meta = ModelType(CloudServiceMeta, default=meta)


class CloudFrontResponse(CloudServiceResponse):
    resource = PolyModelType(DistributionResource)
Ejemplo n.º 9
0
                                    ['ordering', 'pending', 'deleting'],
                                    'disable': ['unknown', 'deleted']
                                }),
        TextDyField.data_source('Region', 'data.region'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Bandwidth', 'data.bandwidth'),
        TextDyField.data_source('Vlan', 'data.vlan'),
        TextDyField.data_source('Partner Name', 'data.partner_name'),
        TextDyField.data_source('Lag ID', 'data.lag_id'),
        TextDyField.data_source('AWS Device', 'data.aws_device'),
        TextDyField.data_source('Provider name', 'data.provider_name'),
        TextDyField.data_source('Owner Account', 'data.owner_account'),
    ])

connection_tags = SimpleTableDynamicLayout.set_tags()
connection_metadata = CloudServiceMeta.set_layouts(
    layouts=[connection, connection_tags])

dcgw = ItemDynamicLayout.set_fields(
    'Direct Connect Gateway',
    fields=[
        TextDyField.data_source('ID', 'data.direct_connect_gateway_id'),
        TextDyField.data_source('Name', 'data.direct_connect_gateway_name'),
        EnumDyField.data_source('State',
                                'data.direct_connect_gateway_state',
                                default_state={
                                    'safe': ['available'],
                                    'disable': ['deleted'],
                                    'warning': ['pending', 'deleting']
                                }),
        TextDyField.data_source('Amazon side ASN', 'data.amazon_side_asn'),
    ])
Ejemplo n.º 10
0
        TextDyField.data_source('Signature Algorithm',
                                'data.signature_algorithm'),
        TextDyField.data_source('ARN', 'data.certificate_arn'),
        # TextDyField.data_source('Validation State', 'data.'),
    ])

# TAB - Tags
acm_meta_tags = TableDynamicLayout.set_fields(
    'Tags',
    'data.tags',
    fields=[
        TextDyField.data_source('Key', 'key'),
        TextDyField.data_source('Value', 'value'),
    ])

acm_meta = CloudServiceMeta.set_layouts(
    [certificate_status, acm_meta_detail, acm_meta_tags])


class ACMResource(CloudServiceResource):
    cloud_service_group = StringType(default='CertificateManager')


class CertificateResource(ACMResource):
    cloud_service_type = StringType(default='Certificate')
    data = ModelType(Certificate)
    _metadata = ModelType(CloudServiceMeta,
                          default=acm_meta,
                          serialized_name='metadata')


class ACMResponse(CloudServiceResponse):
Ejemplo n.º 11
0
    }),
    ListDyField.data_source('Attachment information', 'data.attachments', default_badge={
        'type': 'outline',
        'sub_key': 'instance_id',
    }),
    TextDyField.data_source('KMS Key ID', 'data.kms_key_id'),
    TextDyField.data_source('KMS Key ARN', 'data.kms_key_arn'),
    TextDyField.data_source('IOPS', 'data.iops'),
    EnumDyField.data_source('Multi-Attach Enabled', 'data.multi_attach_enabled', default_badge={
        'indigo.500': ['true'], 'coral.600': ['false']
    }),
    DateTimeDyField.data_source('Created', 'data.create_time'),
])

vol_tags = SimpleTableDynamicLayout.set_tags()
vol_metadata = CloudServiceMeta.set_layouts(layouts=[vol_base, vol_tags])


# SNAPSHOT
ss_base = ItemDynamicLayout.set_fields('Snapshots', fields=[
    TextDyField.data_source('Snapshot ID', 'data.snapshot_id'),
    TextDyField.data_source('ARN', 'data.arn'),
    EnumDyField.data_source('Status', 'data.state', default_state={
        'safe': ['completed'],
        'warning': ['pending'],
        'alert': ['error']
    }),
    TextDyField.data_source('Description', 'data.description'),
    TextDyField.data_source('Progress', 'data.progress'),
    SizeField.data_source('Size', 'data.volume_size', options={
        'source_unit': 'GB',
    'data.environment.variables',
    fields=[
        TextDyField.data_source('Key', 'key'),
        TextDyField.data_source('Value', 'value'),
    ])

function_layers = TableDynamicLayout.set_fields(
    'Layers',
    'data.layers',
    fields=[
        TextDyField.data_source('ARN', 'arn'),
        TextDyField.data_source('Name', 'name'),
        TextDyField.data_source('Code Size', 'code_size'),
    ])

function_metadata = CloudServiceMeta.set_layouts(
    layouts=[function, function_vpc, function_env, function_layers])

layer = ItemDynamicLayout.set_fields(
    'Layers',
    fields=[
        TextDyField.data_source('Name', 'data.layer_name'),
        TextDyField.data_source('ARN', 'data.layer_arn'),
        ListDyField.data_source(
            'Compatible Runtimes',
            'data.latest_matching_version.compatible_runtimes',
            default_badge={
                'type': 'outline',
            }),
        TextDyField.data_source('Version',
                                'data.latest_matching_version.version'),
        TextDyField.data_source('Description',
Ejemplo n.º 13
0
        EnumDyField.data_source('Custom Master Key Spec.',
                                'data.customer_master_key_spec',
                                default_outline_badge=[
                                    'RSA_2048', 'RSA_3072', 'RSA_4096',
                                    'ECC_NIST_P256', 'ECC_NIST_P384',
                                    'ECC_NIST_P521', 'ECC_SECG_P256K1',
                                    'SYMMETRIC_DEFAULT'
                                ]),
        TextDyField.data_source('Custom Key Store ID',
                                'data.custom_key_store_id'),
        TextDyField.data_source('Cloud HSM Cluster ID',
                                'data.cloud_hsm_cluster_id'),
        DateTimeDyField.data_source('Creation Time', 'data.creation_date')
    ])

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


class KMSResource(CloudServiceResource):
    cloud_service_group = StringType(default='KMS')


class KeyResource(KMSResource):
    cloud_service_type = StringType(default='Key')
    data = ModelType(Key)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class KeyResponse(CloudServiceResponse):
Ejemplo n.º 14
0
    fields=[
        EnumDyField.data_source('Rotation Status',
                                'data.rotation_enabled',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                }),
        TextDyField.data_source('Rotation Interval', 'data.rotation_rules'),
        TextDyField.data_source('AWS Lambda Function',
                                'data.rotation_lambda_arn'),
        DateTimeDyField.data_source('Last Rotated date',
                                    'data.last_rotated_date'),
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(layouts=[secrets, rotation, tags])


class SecretsManagerResource(CloudServiceResource):
    cloud_service_group = StringType(default='SecretsManager')


class SecretResource(SecretsManagerResource):
    cloud_service_type = StringType(default='Secret')
    data = ModelType(Secret)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class SecretResponse(CloudServiceResponse):
Ejemplo n.º 15
0
                                '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):
    cloud_service_group = StringType(default='ECR')


class ECRRepositoryResource(ECRResource):
    cloud_service_type = StringType(default='Repository')
    data = ModelType(Repository)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class ECRResponse(CloudServiceResponse):
Ejemplo n.º 16
0
    TextDyField.data_source('Update ID', 'id'),
    EnumDyField.data_source('Status', 'status', default_state={
        'safe': ['Successful'],
        'warning': ['InProgress'],
        'alert': ['Failed'],
        'disable': ['Cancelled']
    }),
    TextDyField.data_source('Type', 'type'),
    DateTimeDyField.data_source('Submission Time', 'created_at'),
    ListDyField.data_source('Error', 'errors.error_code', options={
        'delimiter': '<br>'
    })
])

cluster_tags = SimpleTableDynamicLayout.set_tags()
cluster_metadata = CloudServiceMeta.set_layouts(
    layouts=[cluster_base, cluster_node_groups, cluster_logging, cluster_tags])

node_group_base = ItemDynamicLayout.set_fields('Node Group', fields=[
    TextDyField.data_source('Node Group Name', 'data.nodegroup_name'),
    TextDyField.data_source('Node Group ARN', 'data.nodegroup_arn'),
    EnumDyField.data_source('Status', 'data.status', default_state={
        'safe': ['ACTIVE'],
        'warning': ['CREATING', 'UPDATING', 'DELETING'],
        'alert': ['CREATE_FAILED', 'DELETE_FAILED', 'DEGRADED'],
    }),
    TextDyField.data_source('EKS Cluster Name', 'data.cluster_name'),
    TextDyField.data_source('EKS Cluster ARN', 'data.cluster_arn'),
    TextDyField.data_source('Version', 'data.version'),
    TextDyField.data_source('Release Version', 'data.release_version'),
    ListDyField.data_source('Instance Types', 'data.instance_types', options={
        'delimiter': '<br>'
Ejemplo n.º 17
0
                'coral.600': ['Disabled']
            }),
        EnumDyField.data_source('Access logs',
                                'data.attributes.access_logs_s3_enabled',
                                default_badge={
                                    'indigo.500': ['Enabled'],
                                    'coral.600': ['Disabled']
                                }),
        TextDyField.data_source('Access logs S3 Prefix',
                                'data.attributes.access_logs_s3_prefix'),
        TextDyField.data_source('Access logs S3 Bucket',
                                'data.attributes.access_logs_s3_bucket'),
    ])

lb_tags = SimpleTableDynamicLayout.set_tags()
lb_metadata = CloudServiceMeta.set_layouts(
    layouts=[lb_base, lb_listener, lb_attr, lb_tags])
'''
TARGET GROUP
'''
tg_base = ItemDynamicLayout.set_fields(
    'Target Group',
    fields=[
        TextDyField.data_source('Name', 'data.target_group_name'),
        TextDyField.data_source('ARN', 'data.target_group_arn'),
        EnumDyField.data_source('Protocol',
                                'data.protocol',
                                default_outline_badge=[
                                    'HTTP', 'HTTPS', 'TCP', 'TLS', 'UDP',
                                    'TCP_UDP'
                                ]),
        TextDyField.data_source('Port', 'data.port'),
        'indigo.500': ['BucketOwner'],
        'coral.600': ['Requester']
    }),
])

tags = SimpleTableDynamicLayout.set_tags()

topic_conf = TableDynamicLayout.set_fields('Events', 'data.notification_configurations', fields=[
    TextDyField.data_source('ID', 'id'),
    TextDyField.data_source('Type', 'notification_type'),
    TextDyField.data_source('ARN', 'arn'),
    ListDyField.data_source('Events', 'events'),
])

metadata = CloudServiceMeta.set_layouts(layouts=[bucket, object_info, versioning, website_hosting, server_access_log,
                                                 encryption, object_lock, transfer_acc, requester_pays, topic_conf,
                                                 tags])


class S3Resource(CloudServiceResource):
    cloud_service_group = StringType(default='S3')


class BucketResource(S3Resource):
    cloud_service_type = StringType(default='Bucket')
    data = ModelType(Bucket)
    _metadata = ModelType(CloudServiceMeta, default=metadata, serialized_name='metadata')


class BucketResponse(CloudServiceResponse):
    resource = PolyModelType(BucketResource)
Ejemplo n.º 19
0
            'data.transit_gateway.options.association_default_route_table_id'),
        EnumDyField.data_source(
            'Default propagation route table',
            'data.transit_gateway.options.default_route_table_propagation',
            default_badge={
                'indigo.500': ['enable'],
                'coral.600': ['disable']
            }),
        TextDyField.data_source(
            'Propagation route table ID',
            'data.transit_gateway.options.propagation_default_route_table_id'),
    ])

vpc_tags = SimpleTableDynamicLayout.set_tags()
vpc_metadata = CloudServiceMeta.set_layouts(layouts=[
    vpc, vpc_subnet, vpc_route, vpc_igw, vpc_natgw, vpc_endpoints, vpc_peercon,
    vpc_egress_gw, vpn_gw, vpc_transit_gw, vpc_tags
])

# SUBNET
subnet = ItemDynamicLayout.set_fields(
    'Subnet',
    fields=[
        TextDyField.data_source('Subnet ID', 'data.subnet_id'),
        EnumDyField.data_source('State',
                                'data.state',
                                default_state={
                                    'safe': ['available'],
                                    'warning': ['pending']
                                }),
        TextDyField.data_source('VPC ID', 'data.vpc_id'),
        TextDyField.data_source('IPv4 CIDR', 'data.cidr_block'),
Ejemplo n.º 20
0
kds_meta_enhanced_fan_out = ListDynamicLayout.set_layouts(
    "Enhanced fan-out", layouts=[kds_meta_consumers_using_enhanced_fan_out])

# TAB - Tags
kds_meta_tags = TableDynamicLayout.set_fields(
    "Tags",
    "data.tags",
    fields=[
        TextDyField.data_source("Key", "key"),
        TextDyField.data_source("Value", "value"),
    ],
)

# Overall
kds_meta = CloudServiceMeta.set_layouts([
    kds_meta_detail, kds_meta_configuration, kds_meta_enhanced_fan_out,
    kds_meta_tags
])


class KDSResource(CloudServiceResource):  # service type - group
    cloud_service_group = StringType(default="KinesisDataStream")


class StreamResource(KDSResource):  # service type - name
    cloud_service_type = StringType(default="DataStream")
    data = ModelType(StreamDescription)
    _metadata = ModelType(CloudServiceMeta,
                          default=kds_meta,
                          serialized_name="metadata")

Ejemplo n.º 21
0
                                    'warning':
                                    ['creating', 'updating', 'deleting'],
                                    'disable': ['deleted']
                                }),
        TextDyField.data_source('Availability Zone', 'availability_zone_name'),
        TextDyField.data_source('Subnet', 'subnet_id'),
        TextDyField.data_source('IP Address', 'ip_address'),
        TextDyField.data_source('Network Interface ID',
                                'network_interface_id'),
        ListDyField.data_source('Security Groups',
                                'security_groups',
                                default_badge={'type': 'outline'}),
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(layouts=[base, mount_target, tags])


class EFSResource(CloudServiceResource):
    cloud_service_group = StringType(default='EFS')


class FileSystemResource(EFSResource):
    cloud_service_type = StringType(default='FileSystem')
    data = ModelType(FileSystem)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class FileSystemResponse(CloudServiceResponse):
Ejemplo n.º 22
0
    TextDyField.data_source('Default Result', 'default_result'),
    TextDyField.data_source('Heartbeat Timeout (Seconds)', 'heartbeat_timeout'),
    TextDyField.data_source('Notification Target ARN', 'notification_target_arn'),
    TextDyField.data_source('Role ARN', 'role_arn'),
])

# TAB - Tags
asg_meta_tags = TableDynamicLayout.set_fields('Tags', 'data.tags', fields=[
    TextDyField.data_source('Key', 'key'),
    TextDyField.data_source('Value', 'value'),
    EnumDyField.data_source('Tag New Instances', 'propagate_at_launch', default_badge={
        'indigo.500': ['true'], 'coral.600': ['false']
    }),
])
asg_meta = CloudServiceMeta.set_layouts([asg_meta_autoscaling, asg_meta_lc, asg_meta_lt, asg_meta_instance, asg_meta_elb,
                                         asg_meta_policy, asg_meta_notification, asg_meta_scheduled_action,
                                         asg_meta_lifecycle_hooks, asg_meta_tags])


'''
LAUNCH CONFIGURATION
'''
# TAB - BASE - Launch Configuration
lc_meta_base_lc = ItemDynamicLayout.set_fields('Launch Configuration', fields=[
    TextDyField.data_source('Name', 'data.launch_configuration_name'),
    TextDyField.data_source('ARN', 'data.launch_configuration_arn'),
    TextDyField.data_source('AMI', 'data.image_id'),
    TextDyField.data_source('Instance Type', 'data.instance_type'),
    EnumDyField.data_source('Monitoring', 'data.instance_monitoring.enabled', default_badge={
        'indigo.500': ['true'], 'coral.600': ['false']
    }),
Ejemplo n.º 23
0
                                'container_instance_arn'),
        TextDyField.data_source('EC2 Instance', 'ec2_instance_id'),
        EnumDyField.data_source('Agent Connected',
                                'agent_connected',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                }),
        TextDyField.data_source('Running tasks count', 'running_tasks_count'),
        TextDyField.data_source('Agent Version', 'version_info.agent_version'),
        TextDyField.data_source('Docker Version',
                                'version_info.docker_version'),
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(
    layouts=[base, services, tasks, container_instances, tags])


class ECSResource(CloudServiceResource):
    cloud_service_group = StringType(default='ECS')


class ClusterResource(ECSResource):
    cloud_service_type = StringType(default='Cluster')
    data = ModelType(Cluster)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class ClusterResponse(CloudServiceResponse):
Ejemplo n.º 24
0
                                }),
        TextDyField.data_source('Health Check ID', 'health_check_id'),
        TextDyField.data_source('TTL', 'ttl'),
        TextDyField.data_source('Region', 'region'),
        TextDyField.data_source('Weight', 'weight'),
        TextDyField.data_source('Geolocation', 'geo_location'),
        EnumDyField.data_source('Multivalue Answer',
                                'multi_value_answer',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                }),
        TextDyField.data_source('Set ID', 'set_identifier'),
    ])

metadata = CloudServiceMeta.set_layouts(layouts=[hosted_zone, record_set])


class Route53Resource(CloudServiceResource):
    cloud_service_group = StringType(default='Route53')


class HostedZoneResource(Route53Resource):
    cloud_service_type = StringType(default='HostedZone')
    data = ModelType(HostedZone)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class HostedZoneResponse(CloudServiceResponse):
Ejemplo n.º 25
0
                                'data.instance.backup_retention_period'),
        EnumDyField.data_source('Copy tags to snapshots',
                                'data.instance.copy_tags_to_snapshot',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
                                }),
        DateTimeDyField.data_source('Latest Restore Time',
                                    'data.instance.latest_restorable_time'),
        TextDyField.data_source('Backup Window',
                                'data.instance.preferred_backup_window'),
    ])

instance_tags = SimpleTableDynamicLayout.set_tags()
instance_metadata = CloudServiceMeta.set_layouts(layouts=[
    summary, instance_conn, instance_sec, instance_conf, instance_storage,
    instance_maintenance, instance_backup, instance_tags
])

cluster_endpoint = ItemDynamicLayout.set_fields(
    'Endpoints',
    fields=[
        TextDyField.data_source('Endpoint', 'data.cluster.endpoint'),
        TextDyField.data_source('Port', 'data.cluster.port'),
        TextDyField.data_source('Reader Endpoint',
                                'data.cluster.reader_endpoint'),
    ])

cluster_conf = ItemDynamicLayout.set_fields(
    'Configuration',
    fields=[
        TextDyField.data_source('DB Cluster ID',
Ejemplo n.º 26
0
                                'status',
                                default_state={
                                    'safe': ['available'],
                                }),
        TextDyField.data_source('Port', 'port'),
        TextDyField.data_source('Endpoint', 'endpoint'),
        EnumDyField.data_source('Parameter Group Status',
                                'parameter_group_status',
                                default_state={
                                    'safe': ['in-sync'],
                                }),
        DateTimeDyField.data_source('Created On', 'created_on')
    ])

memcached_tags = SimpleTableDynamicLayout.set_tags()
memcached_metadata = CloudServiceMeta.set_layouts(
    layouts=[memcached_base, memcached_node, memcached_tags])
'''
Redis
'''
redis_base = ItemDynamicLayout.set_fields(
    'Description',
    fields=[
        TextDyField.data_source('Name', 'data.replication_group_id'),
        TextDyField.data_source('ARN', 'data.arn'),
        TextDyField.data_source('Mode', 'data.mode'),
        EnumDyField.data_source(
            'Status',
            'data.status',
            default_state={
                'safe': ['available'],
                'warning':
Ejemplo n.º 27
0
        TextDyField.data_source('Network Interface ID',
                                'data.network_interface_id'),
        BadgeDyField.data_source('Address Pool', 'data.public_ipv4_pool'),
        EnumDyField.data_source('Scope',
                                'data.domain',
                                default_outline_badge=['vpc', 'standard']),
        TextDyField.data_source('Network Interface Owner Account ID',
                                'data.network_interface_owner_id'),
        TextDyField.data_source('Customer owned IP Address',
                                'data.customer_owned_ip'),
        TextDyField.data_source('Customer owned IP Address Pool',
                                'data.customer_owned_ipv4_pool'),
    ])

eip_tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(layouts=[base, eip_tags])


class EC2Resource(CloudServiceResource):
    cloud_service_group = StringType(default='EIP')


class EIPResource(EC2Resource):
    cloud_service_type = StringType(default='EIP')
    data = ModelType(ElasticIPAddress)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class EIPResponse(CloudServiceResponse):
cluster_operations = \
    TableDynamicLayout.set_fields('Operations', root_path='data.cluster_operation_info', fields=[
        TextDyField.data_source('Operation ARN', 'operation_arn'),
        TextDyField.data_source('Cluster ARN', 'cluster_arn'),
        TextDyField.data_source('Operation Type', 'operation_type'),
        TextDyField.data_source('Error Code', 'error_info.error_code'),
        TextDyField.data_source('Error', 'error_info.error_string'),
        DateTimeDyField.data_source('Creation Time', 'Creation Time'),
        DateTimeDyField.data_source('End Time', 'end_time'),
    ])


cluster_metadata = CloudServiceMeta.set_layouts([ cluster_base,
                                                  broker_info,
                                                  cluster_encryption_info,
                                                  cluster_client_authentication,
                                                  cluster_logging_meta,
                                                  cluster_operations,
                                                  cluster_tag
                                                 ])

'''
CONFIGURATION
'''
configuration_base = ItemDynamicLayout.set_fields('General', fields=[
    TextDyField.data_source('Configuration ARN', 'data.arn'),
    TextDyField.data_source('Name', 'data.name'),
    TextDyField.data_source('Description', 'data.description'),
])

configuration_revision = \
    TableDynamicLayout.set_fields('Revisions',
firehose_meta_tags = TableDynamicLayout.set_fields(
    "Tags",
    "data.tags",
    fields=[
        TextDyField.data_source("Key", "key"),
        TextDyField.data_source("Value", "value"),
    ],
)

# Overall
firehose_meta = CloudServiceMeta.set_layouts(
    [firehose_meta_stream_details,
     firehose_meta_source_details,
     firehose_meta_s3_backup,
     firehose_meta_lambda,
     firehose_meta_s3_destination,
     firehose_meta_splunk_destination_details,
     firehose_meta_redshift_destination_details,
     firehose_meta_http_endpoint_destination_details,
     firehose_meta_elasticsearch_destination_description,
     firehose_meta_tags]
)


class FirehoseResource(CloudServiceResource):  # service type - group
    cloud_service_group = StringType(default="KinesisFirehose")


class DeliveryStreamResource(FirehoseResource):  # service type - name
    cloud_service_type = StringType(default="DeliveryStream")
    data = ModelType(DeliveryStreamDescription)
    _metadata = ModelType(
Ejemplo n.º 30
0
    fields=[
        EnumDyField.data_source('Protocol',
                                'protocol_display',
                                default_badge={
                                    'coral.600': ['ALL'],
                                    'indigo.500': ['TCP'],
                                    'peacock.500': ['UDP'],
                                    'green.500': ['ICMP']
                                }),
        TextDyField.data_source('Port range', 'port_display'),
        TextDyField.data_source('Source', 'source_display'),
        TextDyField.data_source('Description', 'description_display'),
    ])

tags = SimpleTableDynamicLayout.set_tags()
metadata = CloudServiceMeta.set_layouts(
    layouts=[sg, inbound_rules, outbound_rules, tags])


class EC2Resource(CloudServiceResource):
    cloud_service_group = StringType(default='EC2')


class SecurityGroupResource(EC2Resource):
    cloud_service_type = StringType(default='SecurityGroup')
    data = ModelType(SecurityGroup)
    _metadata = ModelType(CloudServiceMeta,
                          default=metadata,
                          serialized_name='metadata')


class SecurityGroupResponse(CloudServiceResponse):