from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta


cst_phd = CloudServiceTypeResource()
cst_phd.name = 'Event'
cst_phd.provider = 'aws'
cst_phd.group = 'PersonalHealthDashboard'
cst_phd.labels = ['Management']
cst_phd.is_primary = True
cst_phd.tags = {
    'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/AWS-Personal-Health-Dashboard.svg',
}

cst_phd._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Event', 'data.event_title'),
        EnumDyField.data_source('Status', 'data.status_code', default_state={
            'safe': ['closed'],
            'warning': ['upcoming'],
            'alert': ['open']
        }),
        TextDyField.data_source('Event Category', 'data.event_type_category'),
        TextDyField.data_source('Region', 'region_code'),
        TextDyField.data_source('Affected Resources', 'data.affected_resource_display'),
        DateTimeDyField.data_source('Start Time', 'data.start_time'),
        DateTimeDyField.data_source('Last Update Time', 'data.last_update_time'),
    ],
    search=[
        SearchField.set(name='ARN', key='data.arn'),
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta


cst_sql_database = CloudServiceTypeResource()
cst_sql_database.name = 'SQLDatabase'
cst_sql_database.group = 'SQL'
cst_sql_database.service_code = 'Microsoft.Sql/servers/databases'
cst_sql_database.labels = ['Database']
cst_sql_database.is_major = False
cst_sql_database.is_primary = False
cst_sql_database.tags = {
    'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-sql-databases.svg',
}

cst_sql_database._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Status', 'data.status', default_state={
            'safe': ['Online', 'Creating', 'Copying', 'Creating', 'OnlineChangingDwPerformanceTiers', 'Restoring',
                     'Resuming', 'Scaling', 'Standby'],
            'warning': ['AutoClosed', 'Inaccessible', 'Offline', 'OfflineChangingDwPerformanceTiers',
                        'OfflineSecondary',
                        'Pausing', 'Recovering', 'RecoveryPending', 'Suspect'],
            'disable': ['Disabled', 'Paused', 'Shutdown'],
            'alert': ['EmergencyMode']
        }),
        TextDyField.data_source('Replication Partner Server', 'data.replication_link.partner_server'),
        TextDyField.data_source('Server', 'data.server_name'),
Example #3
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_instance_template = CloudServiceTypeResource()
cst_instance_template.name = 'InstanceTemplate'
cst_instance_template.provider = 'google_cloud'
cst_instance_template.group = 'ComputeEngine'
cst_instance_template.service_code = 'compute'
cst_instance_template.labels = ['Compute']
cst_instance_template.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Compute_Engine.svg',
}
# Basic table for
cst_instance_template._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Machine Type',
                                'data.machine.machine_display'),
        TextDyField.data_source('Image', 'data.image'),
        TextDyField.data_source('Disk Type', 'data.disk_display'),
        ListDyField.data_source('In Used By',
                                'data.in_used_by',
                                default_badge={
                                    'type': 'outline',
                                    'delimiter': '<br>'
                                }),
        DateTimeDyField.data_source('Creation Time',
                                    'data.creation_timestamp'),
    ],
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_virtual_network = CloudServiceTypeResource()
cst_virtual_network.name = 'VirtualNetwork'
cst_virtual_network.group = 'Network'
cst_virtual_network.service_code = 'Microsoft.Network/virtualNetworks'
cst_virtual_network.labels = ['Network']
cst_virtual_network.is_major = True
cst_virtual_network.is_primary = True
cst_virtual_network.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-virtual-networks.svg',
}

cst_virtual_network._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Subscription', 'data.subscription_name')
    ],
    search=[
        SearchField.set(name='ID', key='data.id', data_type='string'),
        SearchField.set(name='Name', key='data.name', data_type='string'),
        SearchField.set(name='Subscription ID',
                        key='data.subscription_id',
                        data_type='string'),
        SearchField.set(name='Subscription Name',
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_snapshot = CloudServiceTypeResource()
cst_snapshot.name = 'Snapshot'
cst_snapshot.provider = 'google_cloud'
cst_snapshot.group = 'ComputeEngine'
cst_snapshot.service_code = 'compute'
cst_snapshot.labels = ['Compute', 'Storage']
cst_snapshot.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Compute_Engine.svg',
}

cst_snapshot._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Status',
                                'data.status',
                                default_state={
                                    'safe': ['READY'],
                                    'warning':
                                    ['CREATING', 'UPLOADING', 'DELETING'],
                                    'alert': ['FAILED'],
                                }),
        ListDyField.data_source('Location', 'data.storage_locations'),
        SizeField.data_source('SnapShot Size', 'data.disk.storage_bytes'),
        TextDyField.data_source('Creation Type', 'data.creation_type'),
        TextDyField.data_source('Source Disk',
                                'data.disk.source_disk_display'),
Example #6
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField, ListDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_external_ip = CloudServiceTypeResource()
cst_external_ip.name = 'ExternalIPAddress'
cst_external_ip.provider = 'google_cloud'
cst_external_ip.group = 'VPC'
cst_external_ip.service_code = 'vpc'
cst_external_ip.labels = ['Networking']
cst_external_ip.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/External_IP_Address.svg',
}

cst_external_ip._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('External Address', 'data.address'),
        TextDyField.data_source('Region', 'data.region'),
        EnumDyField.data_source('Type',
                                'data.is_ephemeral',
                                default_badge={
                                    'indigo.500': ['Static'],
                                    'coral.600': ['Ephemeral']
                                }),
        EnumDyField.data_source('Version',
                                'data.ip_version_display',
                                default_badge={
                                    'indigo.500': ['IPv4'],
                                    'coral.600': ['IPv6']
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_vm_scale_set = CloudServiceTypeResource()
cst_vm_scale_set.name = 'VmScaleSets'
cst_vm_scale_set.group = 'Compute'
cst_vm_scale_set.service_code = 'Microsoft.Compute/virtualMachineScaleSets'
cst_vm_scale_set.labels = ['Compute', 'Storage']
cst_vm_scale_set.is_major = True
cst_vm_scale_set.is_primary = True
cst_vm_scale_set.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-vm-scale-set.svg',
}

cst_vm_scale_set._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        # TextDyField.data_source('Status', 'data.'), (x)
        TextDyField.data_source('Instances', 'data.instance_count'),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source(
            'Default',
            'data.virtual_machine_scale_set_power_state.profiles.capacity.default'
        ),
        TextDyField.data_source(
            'Max',
            'data.virtual_machine_scale_set_power_state.profiles.capacity.maximum'
Example #8
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_network = CloudServiceTypeResource()
cst_network.name = 'VPCNetwork'
cst_network.provider = 'google_cloud'
cst_network.group = 'VPC'
cst_network.service_code = 'vpc'
cst_network.is_primary = True
cst_network.labels = ['Networking']
cst_network.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/VPC.svg',
}

cst_network._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Number of Subnet',
                                'data.subnetwork_data.total_number'),
        TextDyField.data_source('Maximum transmission unit', 'data.mtu'),
        TextDyField.data_source('Mode', 'data.subnet_creation_mode'),
        EnumDyField.data_source('Global Dynamic Routing',
                                'data.global_dynamic_route',
                                default_state={
                                    'safe': ['On'],
                                    'warning': ['Off'],
                                }),
        TextDyField.data_source('Firewall Rules',
                                'data.firewall_data.total_number'),
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_disk = CloudServiceTypeResource()
cst_disk.name = 'Disks'
cst_disk.provider = 'azure'
cst_disk.group = 'Compute'
cst_disk.labels = ['Compute', 'Storage']
cst_disk.service_code = 'Microsoft.Compute/disks'
cst_disk.is_major = True
cst_disk.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-disk.svg',
    'spaceone:display_name': 'Disk'
}

cst_disk._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Storage Account Type', 'data.sku.name'),
        SizeField.data_source('Size', 'data.size'),
        EnumDyField.data_source(
            'Disk State',
            'data.disk_state',
            default_state={
                'safe': ['ActiveSAS', 'ActiveUpload', 'Attached', 'Reserved'],
                'warning': ['ReadyToUpload'],
                'available': ['Unattached']
            }),
Example #10
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_application_gateway = CloudServiceTypeResource()
cst_application_gateway.name = 'ApplicationGateway'
cst_application_gateway.group = 'Network'
cst_application_gateway.service_code = 'Microsoft.Network/applicationGateways'
cst_application_gateway.labels = ['Network']
cst_application_gateway.is_major = False
cst_application_gateway.is_primary = False
cst_application_gateway.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-application-gateways.svg',
}

cst_application_gateway._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Public IP Address',
                                'data.public_ip_address.ip_address'),
        TextDyField.data_source('Private IP Address',
                                'data.private_ip_address'),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Subscription', 'data.subscription_name')
    ],
    search=[
        SearchField.set(name='ID', key='data.id', data_type='string'),
        SearchField.set(name='Name', key='data.name', data_type='string'),
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, EnumDyField, SearchField, DateTimeDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta
'''
ExadataInfrastructure
'''
cst_exadata_infrastructure = CloudServiceTypeResource()
cst_exadata_infrastructure.name = 'ExadataInfrastructure'
cst_exadata_infrastructure.provider = 'oracle_cloud'
cst_exadata_infrastructure.group = 'ExadataCloudDatabase'
cst_exadata_infrastructure.labels = ['Database']
cst_exadata_infrastructure.service_code = 'OracleExadataCloudService'
cst_exadata_infrastructure.is_primary = True
cst_exadata_infrastructure.is_major = True
cst_exadata_infrastructure.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/oci/OCI_icon_Database_Service.svg'
}

cst_exadata_infrastructure._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Display Name', 'data.display_name'),
        EnumDyField.data_source(
            'Lifecycle State',
            'data.lifecycle_state',
            default_state={
                'safe': ['AVAILABLE'],
                'warning':
                ['UPDATING', 'TERMINATING', 'MAINTENANCE_IN_PROGRESS'],
                'alert': ['TERMINATED', 'FAILED']
            }),
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta


cst_sql_database = CloudServiceTypeResource()
cst_sql_database.name = 'SqlDatabases'
cst_sql_database.group = 'Sql'
cst_sql_database.service_code = 'Microsoft.Sql/servers/databases'
cst_sql_database.labels = ['Databases']
cst_sql_database.is_major = False
cst_sql_database.is_primary = False
cst_sql_database.tags = {
    'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-sql-databases.svg',
}

cst_sql_database._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Status', 'data.status', default_state={
            'safe': ['Online', 'Creating', 'Copying', 'Creating', 'OnlineChangingDwPerformanceTiers', 'Restoring',
                     'Resuming', 'Scaling', 'Standby'],
            'warning': ['AutoClosed', 'Inaccessible', 'Offline', 'OfflineChangingDwPerformanceTiers',
                        'OfflineSecondary',
                        'Pausing', 'Recovering', 'RecoveryPending', 'Suspect'],
            'disable': ['Disabled', 'Paused', 'Shutdown'],
            'alert': ['EmergencyMode']
        }),
        TextDyField.data_source('Replication Partner Server', 'data.replication_link.partner_server'),
        TextDyField.data_source('Server', 'data.server_name'),
Example #13
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_sql_workspace = CloudServiceTypeResource()
cst_sql_workspace.name = 'SQLWorkspace'
cst_sql_workspace.provider = 'google_cloud'
cst_sql_workspace.group = 'BigQuery'
cst_sql_workspace.service_code = 'bigquery'
cst_sql_workspace.is_primary = True
cst_sql_workspace.is_major = True
cst_sql_workspace.labels = ['Analytics']
cst_sql_workspace.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Big_Query.svg',
}

cst_sql_workspace._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source(
            'Default Partition Expires',
            'data.default_partition_expiration_ms_display'),
        TextDyField.data_source('Default Table Expires',
                                'data.default_table_expiration_ms_display'),
        EnumDyField.data_source('Visible on Console',
                                'data.visible_on_console',
                                default_badge={
                                    'indigo.500': ['true'],
                                    'coral.600': ['false']
Example #14
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, EnumDyField, SearchField, DateTimeDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_adb = CloudServiceTypeResource()
cst_adb.name = 'Database'
cst_adb.provider = 'oracle_cloud'
cst_adb.group = 'AutonomousDatabase'
cst_adb.labels = ['Database']
cst_adb.service_code = 'OracleAutonomousDatabase'
cst_adb.is_primary = True
cst_adb.is_major = True
cst_adb.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/oci/OCI_icon_Autonomous.svg'
}

cst_adb._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Display Name', 'data.display_name'),
        EnumDyField.data_source(
            'State',
            'data.lifecycle_state',
            default_state={
                'safe': ['AVAILABLE', 'AVAILABLE_NEEDS_ATTENTION'],
                'warning': [
                    'PROVISIONING', 'STOPPING', 'STARTING', 'TERMINATING',
                    'RESTORE_IN_PROGRESS', 'BACKUP_IN_PROGRESS',
                    'SCALE_IN_PROGRESS', 'UPDATING', 'MAINTENANCE_IN_PROGRESS',
                    'RESTARTING', 'RECREATING', 'ROLE_CHANGE_IN_PROGRESS',
                    'UPGRADING'
Example #15
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_bucket = CloudServiceTypeResource()
cst_bucket.name = 'Bucket'
cst_bucket.provider = 'google_cloud'
cst_bucket.group = 'Storage'
cst_bucket.service_code = 'storage'
cst_bucket.is_primary = True
cst_bucket.is_major = True
cst_bucket.labels = ['Storage']
cst_bucket.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Cloud_Storage.svg',
}

cst_bucket._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Location Type',
                                'data.location.location_type'),
        TextDyField.data_source('Location', 'data.location.location_display'),
        EnumDyField.data_source('Default Storage Class',
                                'data.default_storage_class',
                                default_outline_badge=[
                                    'Standard', 'Nearline', 'Coldline',
                                    'Archive'
                                ]),
        EnumDyField.data_source('Public Access',
                                'data.public_access',
Example #16
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, EnumDyField, SearchField, DateTimeDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta
'''
DBSystem
'''
cst_bmvm_dbsystems = CloudServiceTypeResource()
cst_bmvm_dbsystems.name = 'DBSystem'
cst_bmvm_dbsystems.provider = 'oracle_cloud'
cst_bmvm_dbsystems.group = 'BareMetalVMDatabase'
cst_bmvm_dbsystems.labels = ['Database']
cst_bmvm_dbsystems.service_code = 'OracleEnterpriseDatabaseService'
cst_bmvm_dbsystems.is_primary = True
cst_bmvm_dbsystems.is_major = True
cst_bmvm_dbsystems.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/oci/OCI_icon_Database_Service.svg'
}

cst_bmvm_dbsystems._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Display Name', 'data.display_name'),
        EnumDyField.data_source(
            'State',
            'data.lifecycle_state',
            default_state={
                'safe': ['AVAILABLE'],
                'warning': [
                    'UPDATING', 'TERMINATING', 'MAINTENANCE_IN_PROGRESS',
                    'PROVISIONING'
                ],
Example #17
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, ListDyField, SearchField, \
    EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_instance = CloudServiceTypeResource()
cst_instance.name = 'Instance'
cst_instance.provider = 'google_cloud'
cst_instance.group = 'CloudSQL'
cst_instance.labels = ['Database']
cst_instance.is_primary = True
cst_instance.is_major = True
cst_instance.service_code = 'cloudsql'
cst_instance.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Cloud_SQL.svg',
}

cst_instance._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('State',
                                'data.display_state',
                                default_state={
                                    'safe': ['RUNNING'],
                                    'disable': ['UNKNOWN', 'ON-DEMAND'],
                                    'alert': ['STOPPED'],
                                }),
        TextDyField.data_source('Type', 'data.database_version'),
        TextDyField.data_source('Project', 'data.project'),
        ListDyField.data_source('Public IP Address',
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField, ListDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_firewall = CloudServiceTypeResource()
cst_firewall.name = 'Firewall'
cst_firewall.provider = 'google_cloud'
cst_firewall.group = 'VPC'
cst_firewall.service_code = 'vpc'
cst_firewall.labels = ['Networking']
cst_firewall.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Firewall_Rule.svg',
}

cst_firewall._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Logs',
                                'data.display.logs',
                                default_badge={
                                    'indigo.500': ['On'],
                                    'coral.600': ['Off']
                                }),
        TextDyField.data_source('Network', 'data.display.network_display'),
        TextDyField.data_source('Direction', 'data.display.direction_display'),
        TextDyField.data_source('Priority', 'data.priority'),
        EnumDyField.data_source('Action On Match',
                                'data.display.action',
                                default_badge={
                                    'indigo.500': ['Allow'],
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_load_balancer = CloudServiceTypeResource()
cst_load_balancer.name = 'LoadBalancer'
cst_load_balancer.group = 'Network'
cst_load_balancer.service_code = 'Microsoft.Network/loadBalancers'
cst_load_balancer.labels = ['Network']
cst_load_balancer.is_major = True
cst_load_balancer.is_primary = True
cst_load_balancer.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-loadbalancers.svg',
}

cst_load_balancer._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Subscription', 'data.subscription_name'),
    ],
    search=[
        SearchField.set(name='ID', key='data.id', data_type='string'),
        SearchField.set(name='Name', key='data.name', data_type='string'),
        SearchField.set(name='Subscription ID',
                        key='data.subscription_id',
                        data_type='string'),
        SearchField.set(name='Subscription Name',
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta


cst_disk = CloudServiceTypeResource()
cst_disk.name = 'Disk'
cst_disk.provider = 'google_cloud'
cst_disk.group = 'ComputeEngine'
cst_disk.labels = ['Compute', 'Storage']
cst_disk.is_major = True
cst_disk.tags = {
    'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Compute_Engine.svg',
    'spaceone:display_name': 'Disk'
}

cst_disk._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('ID', 'data.id'),
        TextDyField.data_source('Zone', 'data.zone'),
        TextDyField.data_source('Source Image', 'data.source_image_display'),
        EnumDyField.data_source('Disk Type', 'data.disk_type',
                                default_outline_badge=['local-ssd', 'pd-balanced', 'pd-ssd', 'pd-standard']),
        SizeField.data_source('Size', 'data.size'),
        ListDyField.data_source('In Used By', 'data.in_used_by',
                                default_badge={'type': 'outline', 'delimiter': '<br>'}),
        ListDyField.data_source('Snapshot Schedule', 'data.snapshot_schedule_display',
                                default_badge={'type': 'outline', 'delimiter': '<br>'}),
        DateTimeDyField.data_source('Creation Time', 'data.creation_timestamp'),
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_sql_server = CloudServiceTypeResource()
cst_sql_server.name = 'SqlServers'
cst_sql_server.group = 'Sql'
cst_sql_server.service_code = 'Microsoft.Sql/servers'
cst_sql_server.labels = ['Server']
cst_sql_server.is_primary = True
cst_sql_server.is_major = True
cst_sql_server.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-sql-servers.svg',
}

cst_sql_server._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Status',
                                'data.state',
                                default_state={
                                    'safe': ['Ready'],
                                    'warning': ['Disabled']
                                }),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Subscription', 'data.subscription_name'),
    ],
    search=[
Example #22
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_snapshot = CloudServiceTypeResource()
cst_snapshot.name = 'Snapshot'
cst_snapshot.group = 'Compute'
cst_snapshot.service_code = 'Microsoft.Compute/snapshots'
cst_snapshot.labels = ['Compute', 'Storage']
cst_snapshot.is_primary = False
cst_snapshot.is_major = False
cst_snapshot.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-disk-snapshot.svg',
}

cst_snapshot._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Source disk', 'data.source_disk_name'),
        TextDyField.data_source('Snapshot type', 'data.incremental_display'),
        SizeField.data_source('Source disk size', 'data.disk_size_bytes'),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Subscription', 'data.subscription_name'),
        DateTimeDyField.data_source('Time created', 'data.time_created')
    ],
    search=[
        SearchField.set(name='ID', key='data.id', data_type='string'),
        SearchField.set(name='Name', key='data.name', data_type='string'),
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_price = CloudServiceTypeResource()
cst_price.name = 'Product'
cst_price.provider = 'aws'
cst_price.group = 'Pricing'
cst_price.labels = ['Management']
cst_price.tags = {}

cst_price._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Service Code', 'data.service_code'),
        TextDyField.data_source('Product Family', 'data.product_family'),
        TextDyField.data_source('Region', 'data.region_name'),
        TextDyField.data_source('SKU', 'data.sku'),
    ],
    search=[
        SearchField.set(name='Service Code', key='data.service_code'),
        SearchField.set(name='Region', key='data.region_name'),
        SearchField.set(name='Product Family', key='data.product_family'),
        SearchField.set(name='SKU', key='data.sku'),
        SearchField.set(name='Physical Processor',
                        key='data.attributes.physicalProcessor'),
        SearchField.set(name='Processor Features',
                        key='data.attributes.processorFeatures'),
        SearchField.set(name='Instance Type',
                        key='data.attributes.instanceType'),
        SearchField.set(name='Instance Family',
                        key='data.attributes.instanceFamily'),
Example #24
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_machine_image = CloudServiceTypeResource()
cst_machine_image.name = 'MachineImage'
cst_machine_image.provider = 'google_cloud'
cst_machine_image.group = 'ComputeEngine'
cst_machine_image.service_code = 'compute'
cst_machine_image.labels = ['Compute']
cst_machine_image.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Compute_Engine.svg',
}
# Basic table for
cst_machine_image._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Source Instance',
                                'data.machine.machine_display'),
        TextDyField.data_source('Machine Type', 'data.machine.machine_type'),
        ListDyField.data_source('Storage location',
                                'data.storage_locations',
                                default_badge={
                                    'type': 'outline',
                                    'delimiter': '<br>'
                                }),
        DateTimeDyField.data_source('Creation Time',
                                    'data.creation_timestamp'),
    ],
    search=[
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_load_balancing = CloudServiceTypeResource()
cst_load_balancing.name = 'LoadBalancing'
cst_load_balancing.provider = 'google_cloud'
cst_load_balancing.group = 'NetworkService'
cst_load_balancing.service_code = 'netservice'
cst_load_balancing.is_primary = True
cst_load_balancing.is_major = True
cst_load_balancing.labels = ['Networking']
cst_load_balancing.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Load_Balancing.svg',
}

cst_load_balancing._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Protocol',
                                'data.lead_protocol',
                                default_badge={
                                    'primary': ['HTTP', 'HTTPS', 'HTTP(S)'],
                                    'indigo.500': ['TCP', 'TCP (Proxy)'],
                                    'coral.600': ['UDP', 'UDP (Proxy)']
                                }),
        TextDyField.data_source('Region', 'data.region'),
        TextDyField.data_source('Frontends', 'data.frontend_display'),
        TextDyField.data_source('Backends', 'data.backends_display'),
        DateTimeDyField.data_source('Creation Time',
Example #26
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_instance_group = CloudServiceTypeResource()
cst_instance_group.name = 'InstanceGroup'
cst_instance_group.provider = 'google_cloud'
cst_instance_group.group = 'ComputeEngine'
cst_instance_group.service_code = 'compute'
cst_instance_group.labels = ['Compute']
cst_instance_group.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Compute_Engine.svg',
}

cst_instance_group._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Instances', 'data.instance_counts'),
        EnumDyField.data_source(
            'Type',
            'data.instance_group_type',
            default_outline_badge=['STATELESS', 'STATEFUL', 'UNMANAGED']),
        TextDyField.data_source(
            'Min Replicas',
            'data.auto_scaler.autoscaling_policy.min_num_replicas'),
        TextDyField.data_source(
            'Max Replicas',
            'data.auto_scaler.autoscaling_policy.max_num_replicas'),
        TextDyField.data_source('Recommended Size',
                                'data.auto_scaler.recommended_size'),
Example #27
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, EnumDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_ta = CloudServiceTypeResource()
cst_ta.name = 'Check'
cst_ta.provider = 'aws'
cst_ta.group = 'TrustedAdvisor'
cst_ta.labels = ['Management']
cst_ta.is_primary = True
cst_ta.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/aws/AWS-Trusted-Advisor.svg',
}

cst_ta._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Category', 'data.category'),
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Status',
                                'data.status',
                                default_state={
                                    'safe': ['ok'],
                                    'warning': ['warning'],
                                    'alert': ['error'],
                                    'disable': ['not_available']
                                }),
        TextDyField.data_source('Check ID', 'data.check_id'),
    ],
    search=[
        SearchField.set(name='Check ID', key='data.check_id'),
Example #28
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, ListDyField, \
    EnumDyField, SizeField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_sql_server = CloudServiceTypeResource()
cst_sql_server.name = 'SQLServer'
cst_sql_server.group = 'SQL'
cst_sql_server.service_code = 'Microsoft.Sql/servers'
cst_sql_server.labels = ['Database']
cst_sql_server.is_primary = True
cst_sql_server.is_major = True
cst_sql_server.tags = {
    'spaceone:icon':
    'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/azure/azure-sql-servers.svg',
}

cst_sql_server._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        EnumDyField.data_source('Status',
                                'data.state',
                                default_state={
                                    'safe': ['Ready'],
                                    'warning': ['Disabled']
                                }),
        TextDyField.data_source('Resource Group', 'data.resource_group'),
        TextDyField.data_source('Location', 'data.location'),
        TextDyField.data_source('Subscription', 'data.subscription_name'),
    ],
    search=[
Example #29
0
from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, SearchField, DateTimeDyField, EnumDyField, ListDyField
from spaceone.inventory.libs.schema.cloud_service_type import CloudServiceTypeResource, CloudServiceTypeResponse, \
    CloudServiceTypeMeta

cst_route = CloudServiceTypeResource()
cst_route.name = 'Route'
cst_route.provider = 'google_cloud'
cst_route.group = 'VPC'
cst_route.service_code = 'vpc'
cst_route.labels = ['Networking']
cst_route.tags = {
    'spaceone:icon': 'https://spaceone-custom-assets.s3.ap-northeast-2.amazonaws.com/console-assets/icons/cloud-services/google_cloud/Route.svg',
}


cst_route._metadata = CloudServiceTypeMeta.set_meta(
    fields=[
        TextDyField.data_source('Name', 'data.name'),
        TextDyField.data_source('Description', 'data.description'),
        TextDyField.data_source('Destination IP Range', 'data.dest_range'),
        TextDyField.data_source('Priority', 'data.priority'),
        ListDyField.data_source('Instance tags', 'data.display.instance_tags_on_list'),
        TextDyField.data_source('Network', 'data.display.network_display'),
        TextDyField.data_source('Next Hop', 'data.display.next_hop'),
        DateTimeDyField.data_source('Creation Time', 'data.creation_timestamp'),
    ],

    search=[
        SearchField.set(name='ID', key='data.id'),
        SearchField.set(name='Name', key='data.name'),
        SearchField.set(name='Priority', key='data.priority'),