fields=[ 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')
TextDyField.data_source( 'Association route table ID', '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']
fields=[ TextDyField.data_source('Automated Backup (Period Day)', '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(
EnumDyField.data_source('Status', '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={
cluster_update = TableDynamicLayout.set_fields('Updates', 'data.updates', fields=[ 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'),
'warning': ['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'] }),
'subnets', options={ 'sub_key': 'subnet_identifier', }) ]) cluster_parameter = TableDynamicLayout.set_fields( 'Parameters', 'data.parameter_group.parameters', fields=[ TextDyField.data_source('Name', 'parameter_name'), TextDyField.data_source('Value', 'parameter_value'), TextDyField.data_source('Description', 'description'), ]) cluster_tags = SimpleTableDynamicLayout.set_tags() cluster_metadata = CloudServiceMeta.set_layouts(layouts=[ meta_base, cluster_sg, instances, snapshots, cluster_subnet_groups, cluster_parameter, cluster_tags ]) # SUBNET GROUP subnet_group_base = ItemDynamicLayout.set_fields( 'Subnet Groups', fields=[ TextDyField.data_source('Name', 'data.db_subnet_group_name'), TextDyField.data_source('ARN', 'data.db_subnet_group_arn'), EnumDyField.data_source('Status', 'data.subnet_group_status', default_state={'safe': ['Complete']}), TextDyField.data_source('Description',
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' }) ]) instance_tags = SimpleTableDynamicLayout.set_tags() instance_metadata = CloudServiceMeta.set_layouts(layouts=[ instance, instance_addon, instance_hardware, instance_networking, instance_tags ]) class InstanceResource(LightsailResource): cloud_service_type = StringType(default='Instance') data = ModelType(Instance) _metadata = ModelType(CloudServiceMeta, default=instance_metadata, serialized_name='metadata')