from spaceone.inventory.libs.schema.dynamic_field import TextDyField, EnumDyField, SearchField, ListDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_eks_cluster = CloudServiceTypeResource() cst_eks_cluster.name = 'Cluster' cst_eks_cluster.provider = 'aws' cst_eks_cluster.group = 'EKS' cst_eks_cluster.labels = ['Container', 'Compute'] cst_eks_cluster.is_primary = True cst_eks_cluster.is_major = True cst_eks_cluster.service_code = 'AmazonEKS' cst_eks_cluster.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Elastic-Kubernetes-Service.svg', } cst_eks_cluster._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.name'), TextDyField.data_source('Version', 'data.version'), EnumDyField.data_source('Status', 'data.status', default_state={ 'safe': ['ACTIVE'], 'warning': ['CREATING', 'DELETING', 'UPDATING'], 'alert': ['FAILED'] }) ], search=[ SearchField.set(name='Cluster Name', key='data.name'), SearchField.set(name='ARN', key='data.arn'), SearchField.set(name='Status', key='data.status', enums={
'widget/node_total_count.yaml') snapshot_total_count_conf = os.path.join(current_dir, 'widget/snapshot_total_count.yaml') cluster_count_by_region_conf = os.path.join( current_dir, 'widget/cluster_count_by_region.yaml') cluster_count_by_account_conf = os.path.join( current_dir, 'widget/cluster_count_by_account.yaml') node_count_by_account_conf = os.path.join(current_dir, 'widget/node_count_by_account.yaml') snapshot_count_by_account_conf = os.path.join( current_dir, 'widget/snapshot_count_by_account.yaml') snapshot_total_size_by_account_conf = os.path.join( current_dir, 'widget/snapshot_total_size_by_account.yaml') cst_redshift_cluster = CloudServiceTypeResource() cst_redshift_cluster.name = 'Cluster' cst_redshift_cluster.provider = 'aws' cst_redshift_cluster.group = 'Redshift' cst_redshift_cluster.labels = ['Database', 'Analytics'] cst_redshift_cluster.is_primary = True cst_redshift_cluster.is_major = True cst_redshift_cluster.service_code = 'AmazonRedshift' cst_redshift_cluster.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Redshift.svg' } cst_redshift_cluster._metadata = CloudServiceTypeMeta.set_meta( fields=[ EnumDyField.data_source( 'Status',
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_sg = CloudServiceTypeResource() cst_sg.name = 'SecurityGroup' cst_sg.provider = 'aws' cst_sg.group = 'EC2' cst_sg.labels = ['Compute', 'Security'] cst_sg.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-VPC_VPN-Gateway_dark-bg.svg', 'spaceone:is_major': 'true', } cst_sg._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('ID', 'data.group_id'), TextDyField.data_source('Name', 'data.group_name'), TextDyField.data_source('VPC ID', 'data.vpc_id'), TextDyField.data_source('Description', 'data.description'), TextDyField.data_source('Account ID', 'data.owner_id') ], search=[ SearchField.set(name='Security Group ID', key='data.group_id'), SearchField.set(name='Name', key='data.group_name'), SearchField.set(name='VPC ID', key='data.vpc_id'), SearchField.set(name='Inbound Protocol', key='data.ip_permissions.protocol_display'), SearchField.set(name='Inbound Port Rage', key='data.ip_permissions.port_display'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, ListDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_rest_api = CloudServiceTypeResource() cst_rest_api.name = 'RestAPI' cst_rest_api.provider = 'aws' cst_rest_api.group = 'APIGateway' cst_rest_api.labels = ['Networking'] cst_rest_api.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-API-Gateway.svg', 'spaceone:is_major': 'true', } cst_rest_api._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('ID', 'data.id'), TextDyField.data_source('Name', 'data.name'), ListDyField.data_source('Endpoint Type', 'data.endpoint_configuration.types', default_badge={'type': 'outline'}), TextDyField.data_source('Description', 'data.description') ], search=[ SearchField.set(name='Rest API ID', key='data.id'), SearchField.set(name='Name', key='data.name'), SearchField.set(name='ARN', key='data.arn'), SearchField.set(name='API Key Source', key='data.api_key_source'), SearchField.set(name='Creation Time', key='data.created_date',
from spaceone.inventory.libs.schema.dynamic_field import ( SearchField, TextDyField, EnumDyField, ) from spaceone.inventory.libs.schema.resource import ( CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta, ) cst_kds = CloudServiceTypeResource() cst_kds.name = "DataStream" cst_kds.provider = "aws" cst_kds.group = "KinesisDataStream" cst_kds.labels = ["Analytics"] cst_kds.is_primary = True cst_kds.is_major = True cst_kds.service_code = "AmazonKinesis" cst_kds.tags = { "spaceone:icon": "https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Kinesis-Firehose.svg", } cst_kds._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source("Data Stream Name", "data.stream_name"), EnumDyField.data_source( "Status", "data.stream_status_display", default_state={
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField, EnumDyField, SizeField, ListDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_bucket = CloudServiceTypeResource() cst_bucket.name = 'Bucket' cst_bucket.provider = 'aws' cst_bucket.group = 'S3' cst_bucket.labels = ['Storage'] cst_bucket.is_primary = True cst_bucket.is_major = True 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=[ 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',
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, ListDyField, DateTimeDyField, SearchField, \ EnumDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta # CLUSTERS cst_cluster = CloudServiceTypeResource() cst_cluster.name = 'Cluster' cst_cluster.provider = 'aws' cst_cluster.group = 'MSK' cst_cluster.labels = ['Analytics'] cst_cluster.service_code = 'AmazonMSK' cst_cluster.is_primary = True cst_cluster.is_major = True cst_cluster.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-MSK.svg', } cst_cluster._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Cluster name', 'data.cluster_name'), EnumDyField.data_source('Status', 'data.state', default_state={ 'safe': ['ACTIVE'], 'warning': [ 'CREATING', 'DELETING', 'HEALING', 'MAINTENANCE', 'REBOOTING_BROKER' ], 'alert': ['FAILED']
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, DateTimeDyField, EnumDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_filesystem = CloudServiceTypeResource() cst_filesystem.name = 'FileSystem' cst_filesystem.provider = 'aws' cst_filesystem.group = 'EFS' cst_filesystem.labels = ['Storage'] 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', 'spaceone:is_major': 'true', } cst_filesystem._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('ID', 'data.file_system_id'), TextDyField.data_source('Name', 'data.name'), EnumDyField.data_source('State', 'data.life_cycle_state', default_state={ 'safe': ['available'], 'warning': ['creating', 'updating', 'deleting'], 'disable': ['deleted'] }), TextDyField.data_source('Metered Sizes (Bytes)', 'data.size_in_bytes.value'), TextDyField.data_source('Mount Targets', 'data.number_of_mount_targets'), DateTimeDyField.data_source('Creation date', 'data.creation_time'), ], search=[ SearchField.set(name='File System ID', key='data.file_system_id'), SearchField.set(name='ARN', key='data.arn'), SearchField.set(name='Name', key='data.name'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, DateTimeDyField, EnumDyField, \ BadgeDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_rds_database = CloudServiceTypeResource() cst_rds_database.name = 'Database' cst_rds_database.provider = 'aws' cst_rds_database.group = 'RDS' cst_rds_database.labels = ['Database'] cst_rds_database.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-RDS.svg', 'spaceone:is_major': 'true', } cst_rds_database._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('DB Identifier', 'data.db_identifier'), EnumDyField.data_source('Role', 'data.role', default_badge={ 'indigo.500': ['cluster'], 'coral.600': ['instance'] }), EnumDyField.data_source('Engine', 'data.engine', default_outline_badge=[ 'aurora', 'mysql', 'mariadb', 'postgres', 'oracle-ee', 'oracle-se', 'oracle-se1', 'oracle-se2', 'sqlserver-ex', 'sqlserver-web', 'sqlserver-se',
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, EnumDyField, SearchField, ListDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_hostedzone = CloudServiceTypeResource() cst_hostedzone.name = 'HostedZone' cst_hostedzone.provider = 'aws' cst_hostedzone.group = 'Route53' cst_hostedzone.labels = ['Networking'] cst_hostedzone.is_primary = True cst_hostedzone.service_code = 'AmazonRoute53' cst_hostedzone.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Route-53.svg', } cst_hostedzone._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Domain Name', 'data.name'), EnumDyField.data_source('Type', 'data.type', default_badge={ 'indigo.500': ['Public'], 'coral.600': ['Private'] }), TextDyField.data_source('Record Set Count', 'data.resource_record_set_count'), TextDyField.data_source('Comment', 'data.config.comment'), TextDyField.data_source('Host Zone ID', 'data.id'), TextDyField.data_source('ARN', 'data.arn', options={'is_optional': True}),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, DateTimeDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_ecr_repo = CloudServiceTypeResource() cst_ecr_repo.name = 'Repository' cst_ecr_repo.provider = 'aws' cst_ecr_repo.group = 'ECR' cst_ecr_repo.labels = ['Container', 'Compute'] cst_ecr_repo.is_primary = True cst_ecr_repo.service_code = 'AmazonECR' cst_ecr_repo.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-EC2-Container-Registry.svg', } cst_ecr_repo._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Repository name', 'data.repository_name'), TextDyField.data_source('URI', 'data.repository_uri'), DateTimeDyField.data_source('Created', 'data.created_at'), TextDyField.data_source('Registry ARN ', 'data.repository_arn', options={'is_optional': True}), TextDyField.data_source('Image Tag Mutability ', 'data.image_tag_mutability', options={'is_optional': True}), TextDyField.data_source( 'Image Scanning on Push ', 'data.image_scanning_configuration.scan_on_push', options={'is_optional': True}),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_que = CloudServiceTypeResource() cst_que.name = 'Queue' cst_que.provider = 'aws' cst_que.group = 'SQS' cst_que.labels = ['Application Integration'] cst_que.is_primary = True cst_que.is_major = True cst_que.service_code = 'AWSQueueService' cst_que.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-SQS.svg', } cst_que._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('name', 'data.name'), TextDyField.data_source('url', 'data.url'), ], search=[ SearchField.set(name='Name', key='data.name'), SearchField.set(name='ARN', key='data.arn'), SearchField.set(name='URL', key='data.url'), SearchField.set(name='Maximum Message Size (Bytes)', key='data.maximum_message_size', data_type='integer'), SearchField.set(name='Approximate Number of Messages', key='data.approximate_number_of_messages', data_type='integer'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_topic = CloudServiceTypeResource() cst_topic.name = 'Topic' cst_topic.provider = 'aws' cst_topic.group = 'SNS' cst_topic.labels = ['Application Integration'] cst_topic.is_primary = True cst_topic.service_code = 'AmazonSNS' cst_topic.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-SNS.svg', } cst_topic._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.name'), TextDyField.data_source('ARN', 'data.topic_arn', options={'is_optional': True}), TextDyField.data_source('Display Name', 'data.display_name', options={'is_optional': True}), TextDyField.data_source('Subscription Confirmed', 'data.subscription_confirmed', options={'is_optional': True}), TextDyField.data_source('Subscription Pending', 'data.subscriptions_pending', options={'is_optional': True}), TextDyField.data_source('Subscription Deleted',
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, EnumDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta ''' CONNECTION ''' cst_connection = CloudServiceTypeResource() cst_connection.name = 'Connection' cst_connection.provider = 'aws' cst_connection.group = 'DirectConnect' cst_connection.labels = ['Networking'] cst_connection.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/AWS-Direct-Connect.svg', 'spaceone:is_major': 'true', } cst_connection_meta = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Id', 'data.connection_id'), TextDyField.data_source('Name', 'data.connection_name'), EnumDyField.data_source('State', 'data.connection_state', default_state={ 'safe': ['available'], 'available': ['requested'], 'alert': ['down', 'rejected'], 'warning': ['ordering', 'pending', 'deleting'], 'disable': ['unknown', 'deleted'] }),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_sg = CloudServiceTypeResource() cst_sg.name = 'SecurityGroup' cst_sg.provider = 'aws' cst_sg.group = 'EC2' cst_sg.labels = ['Compute', 'Security'] cst_sg.service_code = 'AmazonEC2' cst_sg.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-VPC_VPN-Gateway_dark-bg.svg', } cst_sg._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('ID', 'data.group_id'), TextDyField.data_source('Name', 'data.group_name'), TextDyField.data_source('VPC ID', 'data.vpc_id'), TextDyField.data_source('Description', 'data.description'), TextDyField.data_source('Account ID', 'data.owner_id') ], search=[ SearchField.set(name='Security Group ID', key='data.group_id'), SearchField.set(name='Name', key='data.group_name'), SearchField.set(name='VPC ID', key='data.vpc_id'), SearchField.set(name='Inbound Protocol', key='data.ip_permissions.protocol_display'), SearchField.set(name='Inbound Port Rage', key='data.ip_permissions.port_display'),
''' Instance ''' instance_total_count_conf = os.path.join(current_dir, 'widget/instance_total_count.yaml') instance_count_by_account_conf = os.path.join( current_dir, 'widget/instance_count_by_account.yaml') instance_count_by_region_conf = os.path.join( current_dir, 'widget/instance_count_by_region.yaml') instance_count_by_blueprint_conf = os.path.join( current_dir, 'widget/instance_count_by_blueprint.yaml') instance_count_by_bundle_id_conf = os.path.join( current_dir, 'widget/instance_count_by_bundle_id.yaml') cst_instance = CloudServiceTypeResource() cst_instance.name = 'Instance' cst_instance.provider = 'aws' cst_instance.group = 'Lightsail' cst_instance.labels = ['Compute'] cst_instance.is_primary = True cst_instance.is_major = True cst_instance.service_code = 'AmazonLightsail' cst_instance.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Lightsail.svg', } cst_instance._metadata = CloudServiceTypeMeta.set_meta( fields=[ EnumDyField.data_source('State', 'data.state.name',
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, ListDyField, DateTimeDyField, SearchField, EnumDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_asg = CloudServiceTypeResource() cst_asg.name = 'AutoScalingGroup' cst_asg.provider = 'aws' cst_asg.group = 'EC2' cst_asg.labels = ['Compute'] cst_asg.service_code = 'AmazonEC2' cst_asg.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-EC2-Auto-Scaling.svg', } cst_asg._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.auto_scaling_group_name'), TextDyField.data_source('Desired', 'data.desired_capacity'), TextDyField.data_source('Min', 'data.min_size'), TextDyField.data_source('Max', 'data.max_size'), TextDyField.data_source('Launch Template / Configuration', 'data.display_launch_configuration_template'), ListDyField.data_source('AZ', 'data.availability_zones', default_badge={'delimiter': '<br>'}) ], search=[ SearchField.set(name='Name', key='data.auto_scaling_group_name'), SearchField.set(name='ARN', key='data.auto_scaling_group_arn'), SearchField.set(name='Launch Configuration Name', key='data.launch_configuration_name'), SearchField.set(name='Availability Zone', key='data.availability_zones'), SearchField.set(name='Creation Time', key='data.created_time', data_type='datetime'), SearchField.set(name='Instance ID', key='data.instances.instance_id'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_memcached = CloudServiceTypeResource() cst_memcached.name = 'Memcached' cst_memcached.provider = 'aws' cst_memcached.group = 'ElastiCache' cst_memcached.labels = ['Database'] cst_memcached.tags = { 'spaceone:icon': '', 'spaceone:is_major': 'true', } cst_memcached._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Cluster Name', 'data.cluster_name'), TextDyField.data_source('Nodes', 'data.node_count'), TextDyField.data_source('Node Type', 'data.node_type'), TextDyField.data_source('Zone', 'data.zone'), TextDyField.data_source('Configuration Endpoint', 'data.configuration_endpoint'), TextDyField.data_source('Status', 'data.status'), TextDyField.data_source('Update Action Status', 'data.update_action_status'), ], search=[] ) cst_redis = CloudServiceTypeResource() cst_redis.name = 'Redis' cst_redis.provider = 'aws' cst_redis.group = 'ElastiCache'
current_dir = os.path.abspath(os.path.dirname(__file__)) """ VOLUME """ vol_total_count_conf = os.path.join(current_dir, 'widget/vol_total_count.yaml') vol_total_size_conf = os.path.join(current_dir, 'widget/vol_total_size.yaml') vol_total_size_by_region_conf = os.path.join(current_dir, 'widget/vol_total_size_by_region.yaml') vol_total_size_by_account_conf = os.path.join(current_dir, 'widget/vol_total_size_by_account.yaml') vol_total_size_by_az_conf = os.path.join(current_dir, 'widget/vol_total_size_by_az.yaml') vol_total_size_by_type_conf = os.path.join(current_dir, 'widget/vol_total_size_by_type.yaml') vol_total_size_by_state_conf = os.path.join(current_dir, 'widget/vol_total_size_by_state.yaml') cst_ebs = CloudServiceTypeResource() cst_ebs.name = 'Volume' cst_ebs.provider = 'aws' cst_ebs.group = 'EC2' cst_ebs.labels = ['Compute', 'Storage'] cst_ebs.is_primary = True cst_ebs.is_major = True 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'],
'widget/cluster_total_count.yaml') instance_total_count_conf = os.path.join(current_dir, 'widget/instance_total_count.yaml') snapshot_total_count_conf = os.path.join(current_dir, 'widget/snapshot_total_count.yaml') cluster_count_by_region_widget_conf = os.path.join( current_dir, 'widget/cluster_count_by_region.yaml') cluster_count_by_account_widget_conf = os.path.join( current_dir, 'widget/cluster_count_by_account.yaml') instance_count_by_az_widget_conf = os.path.join( current_dir, 'widget/instance_count_by_az.yaml') instance_count_by_instance_type_widget_conf = os.path.join( current_dir, 'widget/instance_count_by_instance_type.yaml') cst_cluster = CloudServiceTypeResource() cst_cluster.name = 'Cluster' cst_cluster.provider = 'aws' cst_cluster.group = 'DocumentDB' cst_cluster.labels = ['Database'] cst_cluster.is_primary = True cst_cluster.is_major = True cst_cluster.service_code = 'AmazonDocDB' cst_cluster.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-DocumentDB.svg', } cst_cluster._metadata = CloudServiceTypeMeta.set_meta( fields=[ EnumDyField.data_source('Status', 'data.status', default_state={
total_count_conf = os.path.join(current_dir, 'widget/total_count.yaml') active_service_total_count_conf = os.path.join( current_dir, 'widget/active_service_total_count.yaml') running_task_total_count_conf = os.path.join( current_dir, 'widget/running_task_total_count.yaml') cluster_count_by_region_conf = os.path.join( current_dir, 'widget/cluster_count_by_region.yaml') cluster_count_by_account_conf = os.path.join( current_dir, 'widget/cluster_count_by_account.yaml') active_service_count_by_cluster_conf = os.path.join( current_dir, 'widget/active_service_count_by_cluster.yaml') running_task_count_by_cluster_conf = os.path.join( current_dir, 'widget/running_task_count_by_cluster.yaml') cst_ecs_cluster = CloudServiceTypeResource() cst_ecs_cluster.name = 'Cluster' cst_ecs_cluster.provider = 'aws' cst_ecs_cluster.group = 'ECS' cst_ecs_cluster.labels = ['Container', 'Compute'] cst_ecs_cluster.is_primary = True cst_ecs_cluster.is_major = True cst_ecs_cluster.service_code = 'AmazonECS' cst_ecs_cluster.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Elastic-Container-Service.svg', } cst_ecs_cluster._metadata = CloudServiceTypeMeta.set_meta( fields=[ EnumDyField.data_source('Status', 'data.status',
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, ListDyField, EnumDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_distribution = CloudServiceTypeResource() cst_distribution.name = 'Distribution' cst_distribution.provider = 'aws' cst_distribution.group = 'CloudFront' cst_distribution.labels = ['Networking'] cst_distribution.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-CloudFront.svg', 'spaceone:is_major': 'false', } cst_distribution._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Id', 'data.id'), TextDyField.data_source('Domain Name', 'data.domain_name'), EnumDyField.data_source('Status', 'data.status', default_state={'safe': ['Deployed']}), ListDyField.data_source('CNAME', 'data.alias_icp_recordals', default_badge={ 'type': 'outline', 'sub_key': 'cname', }), ], search=[ SearchField.set(name='Distribution ID', key='data.id'), SearchField.set(name='ARN', key='data.arn'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, EnumDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_eks_cluster = CloudServiceTypeResource() cst_eks_cluster.name = 'Cluster' cst_eks_cluster.provider = 'aws' cst_eks_cluster.group = 'EKS' cst_eks_cluster.labels = ['Container'] cst_eks_cluster.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-Elastic-Kubernetes-Service.svg', 'spaceone:is_major': 'true', } cst_eks_cluster._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.name'), TextDyField.data_source('Version', 'data.version'), EnumDyField.data_source('Status', 'data.status', default_state={ 'safe': ['ACTIVE'], 'warning': ['CREATING', 'DELETING', 'UPDATING'], 'alert': ['FAILED'] }) ], search=[ SearchField.set(name='Cluster Name', key='data.name'), SearchField.set(name='ARN', key='data.arn'), SearchField.set(name='Status', key='data.status', enums={ 'ACTIVE': {'label': 'ACTIVE', 'icon': {'color': 'green.500'}}, 'CREATING': {'label': 'CREATING', 'icon': {'color': 'yellow.500'}},
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, DateTimeDyField, SearchField, ListDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_secret = CloudServiceTypeResource() cst_secret.name = 'Secret' cst_secret.provider = 'aws' cst_secret.group = 'SecretsManager' cst_secret.labels = ['Security'] cst_secret.is_primary = True cst_secret.service_code = 'AWSSecretsManager' cst_secret.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/AWS-Secrets-Manager.svg', } cst_secret._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.name'), TextDyField.data_source('Description', 'data.description'), DateTimeDyField.data_source('Last Retrieved', 'data.last_accessed_date'), TextDyField.data_source('ARN', 'data.arn', options={ 'is_optional': True }), TextDyField.data_source('KMS Key ID', 'data.kms_key_id', options={ 'is_optional': True }), TextDyField.data_source('Rotation Enabled', 'data.rotation_enabled', options={ 'is_optional': True }), TextDyField.data_source('Rotation Lambda ARN', 'data.rotation_lambda_arn', options={ 'is_optional': True
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, BadgeDyField, ListDyField, SearchField, SizeField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_function = CloudServiceTypeResource() cst_function.name = 'Function' 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'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_api = CloudServiceTypeResource() cst_api.name = 'API' cst_api.provider = 'aws' cst_api.group = 'APIGateway' cst_api.labels = ['Networking'] cst_api.is_primary = True cst_api.is_major = True cst_api.service_code = 'AmazonApiGateway' cst_api.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-API-Gateway.svg', } cst_api._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('ID', 'data.id'), TextDyField.data_source('Name', 'data.name'), EnumDyField.data_source('Protocol', 'data.protocol', default_outline_badge=['REST', 'WEBSOCKET', 'HTTP']), TextDyField.data_source('Endpoint Type', 'data.endpoint_type'), DateTimeDyField.data_source('Creation Time', 'data.created_date') ], search=[ SearchField.set(name='ID', key='data.id'), SearchField.set(name='Name', key='data.name'), SearchField.set(name='ARN', key='data.arn'), SearchField.set(name='Protocol', key='data.protocol'), SearchField.set(name='Endpoint Type', key='data.endpoint_type'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, ListDyField, DateTimeDyField, SearchField, EnumDyField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_certi = CloudServiceTypeResource() cst_certi.name = 'Certificate' cst_certi.provider = 'aws' cst_certi.group = 'CertificateManager' cst_certi.labels = ['Security'] cst_certi.service_code = 'AWSCertificateManager' cst_certi.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/AWS-Certificate-Manager.svg', } cst_certi._metadata = CloudServiceTypeMeta.set_meta( fields=[ # TextDyField.data_source('Name', 'data.'), TextDyField.data_source('Domain Name', 'data.domain_name'), ListDyField.data_source('Additional Names', 'data.additional_names_display', options={"delimiter": ", "}), EnumDyField.data_source('Status', 'data.status', default_state={ 'safe': ['ISSUED'], 'warning': [ 'PENDING_VALIDATION', 'INACTIVE', 'VALIDATION_TIMED_OUT', 'REVOKED' ], 'alert': ['EXPIRED', 'FAILED']
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, ListDyField, EnumDyField, SearchField, SizeField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, CloudServiceTypeMeta cst_table = CloudServiceTypeResource() cst_table.name = 'Table' cst_table.provider = 'aws' cst_table.group = 'DynamoDB' cst_table.labels = ['Database'] cst_table.is_primary = True cst_table.is_major = True cst_table.service_code = 'AmazonDynamoDB' cst_table.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-DynamoDB.svg', } cst_table._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.table_name'), EnumDyField.data_source( 'Status', 'data.table_status', default_state={ 'safe': ['ACTIVE'], 'warning': ['CREATING', 'UPDATING', 'DELETING', 'ARCHIVING'], 'alert': ['INACCESSIBLE_ENCRYPTION_CREDENTIALS', 'ARCHIVED'] }), TextDyField.data_source('Partition Key', 'data.partition_key_display'), TextDyField.data_source('Sort Key', 'data.sort_key_display'), TextDyField.data_source('Indexes', 'data.index_count'), TextDyField.data_source('Total read capacity', 'data.total_read_capacity'),
from spaceone.inventory.libs.schema.dynamic_field import TextDyField, EnumDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta cst_eip = CloudServiceTypeResource() cst_eip.name = 'EIP' cst_eip.provider = 'aws' cst_eip.group = 'EC2' cst_eip.labels = ['Networking', 'Compute'] cst_eip.is_major = True cst_eip.service_code = 'AmazonEC2' cst_eip.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Amazon-EC2_Elastic-IP-Address_light-bg.svg', } cst_eip._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('Name', 'data.name'), TextDyField.data_source('Public IP', 'data.public_ip'), TextDyField.data_source('Private IP', 'data.private_ip_address'), TextDyField.data_source('Address Pool', 'data.public_ipv4_pool'), EnumDyField.data_source('Scope', 'data.domain', default_outline_badge=['vpc', 'standard']), TextDyField.data_source('Associate Instance ID', 'data.instance_id'), TextDyField.data_source('Public DNS', 'data.public_dns', options={'is_optional': True}), TextDyField.data_source('NAT Gateway ID', 'data.nat_gateway_id',
DateTimeDyField, EnumDyField, SearchField from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \ CloudServiceTypeMeta current_dir = os.path.abspath(os.path.dirname(__file__)) """ LOAD BALANCER """ total_count_conf = os.path.join(current_dir, 'widget/total_count.yaml') count_by_region_conf = os.path.join(current_dir, 'widget/count_by_region.yaml') count_by_account_conf = os.path.join(current_dir, 'widget/count_by_account.yaml') instance_total_count_conf = os.path.join(current_dir, 'widget/instance_total_count.yaml') cst_elb = CloudServiceTypeResource() cst_elb.name = 'LoadBalancer' cst_elb.provider = 'aws' cst_elb.group = 'ELB' cst_elb.labels = ['Networking'] cst_elb.is_primary = True cst_elb.is_major = True cst_elb.service_code = 'AWSELB' cst_elb.tags = { 'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/Elastic-Load-Balancing.svg', } cst_elb._metadata = CloudServiceTypeMeta.set_meta( fields=[ TextDyField.data_source('DNS Name', 'data.dns_name'), EnumDyField.data_source('State', 'data.state.code', default_state={ 'safe': ['active'],