Skip to content
Snippets Groups Projects
Commit adff34a7 authored by Ryo Yamashita's avatar Ryo Yamashita Committed by Yas Naoi
Browse files

Issue #3264410 by Ryo Yamashita, yas: Add entity list views for OpenStack in SPA

parent 2296a60f
No related branches found
No related tags found
4 merge requests!1316Issue #3310263: Release 4.5.0,!1260Issue #3307397: Release 4.4.0,!804Issue #3272190: Release 4.1.0,!673Issue #3264410: Add entity list views for OpenStack in SPA
...@@ -30,6 +30,11 @@ const K8S_LAUNCH_TEMPLATE_LIST: EntityColumn[] = [ ...@@ -30,6 +30,11 @@ const K8S_LAUNCH_TEMPLATE_LIST: EntityColumn[] = [
const DEFAULT_K8S_LAUNCH_TEMPLATE: EntityColumn = { labelName: 'Cloud Service Provider ID', name: 'cloud_context', type: 'default' }; const DEFAULT_K8S_LAUNCH_TEMPLATE: EntityColumn = { labelName: 'Cloud Service Provider ID', name: 'cloud_context', type: 'default' };
// Template for displaying the Launch template in OpenStack.
const OPENSTACK_LAUNCH_TEMPLATE_LIST: EntityColumn[] = [];
const DEFAULT_OPENSTACK_LAUNCH_TEMPLATE: EntityColumn = { labelName: 'Cloud Service Provider ID', name: 'cloud_context', type: 'default' };
/** /**
* Get LaunchTemplateColumnList by cloud_context. * Get LaunchTemplateColumnList by cloud_context.
* *
...@@ -52,8 +57,13 @@ const getLaunchTemplateColumnList = (cloudContext: CloudContext): EntityColumn[] ...@@ -52,8 +57,13 @@ const getLaunchTemplateColumnList = (cloudContext: CloudContext): EntityColumn[]
DEFAULT_K8S_LAUNCH_TEMPLATE, DEFAULT_K8S_LAUNCH_TEMPLATE,
...K8S_LAUNCH_TEMPLATE_LIST ...K8S_LAUNCH_TEMPLATE_LIST
]; ];
default: case 'openstack':
throw new Error('It is an unknown Cloud Context.'); return cloudContext.name !== 'ALL'
? OPENSTACK_LAUNCH_TEMPLATE_LIST
: [
DEFAULT_OPENSTACK_LAUNCH_TEMPLATE,
...OPENSTACK_LAUNCH_TEMPLATE_LIST
];
} }
}; };
......
...@@ -1577,5 +1577,307 @@ ...@@ -1577,5 +1577,307 @@
} }
] ]
} }
],
[
{
"cloudServiceProvider": "openstack",
"labelName": "Instances",
"entityName": "instance",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "Image",
"name": "image_id",
"type": "default"
},
{
"labelName": "Public IP",
"name": "public_ip",
"type": "join",
"info": {
"entityTypeId": "openstack_floating_ip",
"keyColumn": "public_ip",
"valueColumn": "name"
}
},
{
"labelName": "Instance State",
"name": "instance_state",
"type": "default"
},
{
"labelName": "Flavor",
"name": "instance_type",
"type": "default"
},
{
"labelName": "Availability Zone",
"name": "availability_zone",
"type": "default"
},
{
"labelName": "Created",
"name": "created",
"type": "datetime"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Images",
"entityName": "image",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "AMI Name",
"name": "ami_name",
"type": "default"
},
{
"labelName": "AMI ID",
"name": "image_id",
"type": "default"
},
{
"labelName": "Status",
"name": "status",
"type": "default"
},
{
"labelName": "Source",
"name": "source",
"type": "default"
},
{
"labelName": "Root Device Type",
"name": "root_device_type",
"type": "default"
},
{
"labelName": "Visibility",
"name": "visibility",
"type": "boolean",
"value": [
"Public",
"Private"
]
},
{
"labelName": "Created",
"name": "created",
"type": "datetime"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Security groups",
"entityName": "security_group",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "Group ID",
"name": "group_id",
"type": "default"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Floating IPs",
"entityName": "floating_ip",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "Allocation ID",
"name": "allocation_id",
"type": "default"
},
{
"labelName": "Floating IP",
"name": "public_ip",
"type": "default"
},
{
"labelName": "Instance ID",
"name": "instance_id",
"type": "join",
"info": {
"entityTypeId": "openstack_instance",
"keyColumn": "instance_id",
"valueColumn": "name"
}
},
{
"labelName": "Private IP Address",
"name": "private_ip_address",
"type": "default"
},
{
"labelName": "Scope",
"name": "scope",
"type": "default"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Network interfaces",
"entityName": "network_interface",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "Subnet ID",
"name": "subnet_id",
"type": "default"
},
{
"labelName": "Status",
"name": "status",
"type": "default"
},
{
"labelName": "Security groups",
"name": "security_groups",
"type": "join",
"info": {
"entityTypeId": "openstack_security_group",
"keyColumn": "name",
"valueColumn": "name"
}
},
{
"labelName": "Primary Private IP",
"name": "primary_private_ip",
"type": "default"
},
{
"labelName": "Secondary Private IPs",
"name": "secondary_private_ips",
"type": "default"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Key pairs",
"entityName": "key_pair",
"entityColumn": [
{
"labelName": "Key pair name",
"name": "key_pair_name",
"type": "default"
},
{
"labelName": "Key Fingerprint",
"name": "key_fingerprint",
"type": "default"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Volumes",
"entityName": "volume",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "Volume ID",
"name": "volume_id",
"type": "default"
},
{
"labelName": "Size",
"name": "size",
"type": "default"
},
{
"labelName": "Availability Zone",
"name": "availability_zone",
"type": "default"
},
{
"labelName": "Volume type",
"name": "volume_type",
"type": "default"
},
{
"labelName": "Attachment Information",
"name": "attachment_information",
"type": "join",
"info": {
"entityTypeId": "openstack_instance",
"keyColumn": "instance_id",
"valueColumn": "name"
}
},
{
"labelName": "State",
"name": "state",
"type": "default"
},
{
"labelName": "Created",
"name": "created",
"type": "datetime"
}
]
},
{
"cloudServiceProvider": "openstack",
"labelName": "Snapshots",
"entityName": "snapshot",
"entityColumn": [
{
"labelName": "Name",
"name": "name",
"type": "default"
},
{
"labelName": "Snapshot ID",
"name": "snapshot_id",
"type": "default"
},
{
"labelName": "Size",
"name": "size",
"type": "default"
},
{
"labelName": "Status",
"name": "status",
"type": "default"
},
{
"labelName": "Created",
"name": "created",
"type": "datetime"
}
]
}
] ]
] ]
...@@ -8,7 +8,10 @@ const AWS_MENU_LIST = menu_template[0] as MenuTemplate[]; ...@@ -8,7 +8,10 @@ const AWS_MENU_LIST = menu_template[0] as MenuTemplate[];
// Template for displaying a list of entities in K8s. // Template for displaying a list of entities in K8s.
const K8S_MENU_LIST = menu_template[1] as MenuTemplate[]; const K8S_MENU_LIST = menu_template[1] as MenuTemplate[];
export const MENU_TEMPLATE_LIST = [...AWS_MENU_LIST, ...K8S_MENU_LIST]; // Template for displaying a list of entities in OpenStack.
const OPENSTACK_MENU_LIST = menu_template[2] as MenuTemplate[];
export const MENU_TEMPLATE_LIST = [...AWS_MENU_LIST, ...K8S_MENU_LIST, ...OPENSTACK_MENU_LIST];
export const getMenuTemplateList = (cloudServiceProvider: CloudServiceProvider) => { export const getMenuTemplateList = (cloudServiceProvider: CloudServiceProvider) => {
switch (cloudServiceProvider) { switch (cloudServiceProvider) {
...@@ -16,7 +19,7 @@ export const getMenuTemplateList = (cloudServiceProvider: CloudServiceProvider) ...@@ -16,7 +19,7 @@ export const getMenuTemplateList = (cloudServiceProvider: CloudServiceProvider)
return AWS_MENU_LIST; return AWS_MENU_LIST;
case 'k8s': case 'k8s':
return K8S_MENU_LIST; return K8S_MENU_LIST;
default: case 'openstack':
throw new Error('It is an unknown Cloud Context.'); return OPENSTACK_MENU_LIST;
} }
} }
...@@ -25,8 +25,9 @@ export const CACHE_EXPIRED_UNIXTIME = 1000 * 60 * 60 * 24; ...@@ -25,8 +25,9 @@ export const CACHE_EXPIRED_UNIXTIME = 1000 * 60 * 60 * 24;
export const DEFAULT_CLOUD_CONTEXTS: CloudContext[] = [ export const DEFAULT_CLOUD_CONTEXTS: CloudContext[] = [
{ cloudServiceProvider: 'aws_cloud', name: 'ALL', labelName: 'AWS Cloud (ALL)' }, { cloudServiceProvider: 'aws_cloud', name: 'ALL', labelName: 'AWS Cloud (ALL)' },
{ cloudServiceProvider: 'k8s', name: 'ALL', labelName: 'K8s (ALL)' }, { cloudServiceProvider: 'k8s', name: 'ALL', labelName: 'K8s (ALL)' },
{ cloudServiceProvider: 'openstack', name: 'ALL', labelName: 'OpenStack (ALL)' },
]; ];
export const CLOUD_SERVICE_PROVIDER_LIST: CloudServiceProvider[] = [ export const CLOUD_SERVICE_PROVIDER_LIST: CloudServiceProvider[] = [
'aws_cloud', 'k8s' 'aws_cloud', 'k8s', 'openstack',
]; ];
...@@ -25,6 +25,8 @@ export const getProjectColumnList = (cloudContext: CloudContext): EntityColumn[] ...@@ -25,6 +25,8 @@ export const getProjectColumnList = (cloudContext: CloudContext): EntityColumn[]
switch (cloudContext.cloudServiceProvider) { switch (cloudContext.cloudServiceProvider) {
case 'aws_cloud': case 'aws_cloud':
return []; return [];
case 'openstack':
return [];
case 'k8s': case 'k8s':
return cloudContext.name !== 'ALL' return cloudContext.name !== 'ALL'
? K8S_PROJECT_TEMPLATE_LIST ? K8S_PROJECT_TEMPLATE_LIST
......
type CloudServiceProvider = 'aws_cloud' | 'k8s'; type CloudServiceProvider = 'aws_cloud' | 'k8s' | 'openstack';
export default CloudServiceProvider; export default CloudServiceProvider;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment