Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form conversion: Networks/Subnets Add #6861

Closed
7 tasks done
himdel opened this issue Apr 3, 2020 · 8 comments · Fixed by #7734
Closed
7 tasks done

Form conversion: Networks/Subnets Add #6861

himdel opened this issue Apr 3, 2020 · 8 comments · Fixed by #7734

Comments

@himdel
Copy link
Contributor

himdel commented Apr 3, 2020

Convert form to use DDF/React and API - parent issue #6825

Location: Networks/Subnets
Form: Add

current type: Angular
API state:
Need info

PM Input: 2 - Medium
Comments:
Ems common

imported status: NOT ASSIGNED

@skateman
Copy link
Member

skateman commented Oct 5, 2020

@agrare how much is this form tied to a single provider? Trying to determine how much is this analogous with the Cloud Network form and decide if we need an API-provided schema or just a conditional single field based on a supports call.

@jaywcarman
Copy link
Member

just a conditional single field based on a supports call.

There are actually quite a few differences between the existing form and the IbmCloud::PowerVirtualServers API parameters - we ignore some fields and are only able to support our API's public or private network type (not both). #7383 is intended to be the absolute minimum UI change required in order to get some initial functionality.

@skateman
Copy link
Member

skateman commented Oct 5, 2020

@jaywcarman thanks, after we finalized the schemas in #7334, we can specify the schema differences in this case as well.

@skateman
Copy link
Member

Blocked by ManageIQ/manageiq-api#918

@skateman
Copy link
Member

I'd need some definitions for each provider's form, how it should look like & behave, what should be required, etc. cc @agrare

@jaywcarman
Copy link
Member

@skateman I'm searching around and I think only the OpenStack provider supports network create, and OpenStack + Nuage providers supports subnet create.

I'll start putting together schemas for OpenStack and IBM Cloud PowerVS. I don't mind also doing an initial draft for Nuage - but will probably need some help from @agrare.

@jaywcarman
Copy link
Member

Here's a rough draft of OpenStack network create:

# ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork
[
  # TODO: "Network Provider" selection
  ## Placement
  {
    :component => 'select',
    :name      => 'cloud_tenant',
    :id        => 'cloud_tenant',
    :label     => _('Cloud Tenant'),
    # TODO: Get list of tenents for selected network manager
    :options   => ems.cloud_volume_types.map do |cvt|
      {
        :label => cvt.description,
        :value => cvt.name,
      }
    end,
  },
  ## Network Provider Information
  {
    :component => 'select',
    :name      => 'provider_network_type',
    :id        => 'provider_network_type',
    :label     => _('Provider Network Type'),
    # TODO: Get list of network types for selected network manager/placement
    :options   => ems.cloud_volume_types.map do |cvt|
      {
        :label => cvt.description,
        :value => cvt.name,
      }
    end,
  },
  # Network Information
  {
    :component  => 'text-field',
    :id         => 'network_name',
    :name       => 'network_name',
    :label      => _('Network Name'),
    :isRequired => true,
    :validate   => [{:type => "required"}]
  },
  {
    :component => 'switch',
    :id        => 'external_router',
    :name      => 'external_router',
    :label     => _('External Router'),
  },
  {
    :component => 'switch',
    :id        => 'administrative_state',
    :name      => 'administrative_state',
    :label     => _('Administrative State'),
  },
  {
    :component => 'switch',
    :id        => 'shared',
    :name      => 'shared',
    :label     => _('Shared'),
    :onText    => 'Up',
    :offText   => 'Down',
  },
]

@jaywcarman
Copy link
Member

jaywcarman commented Feb 10, 2021

Here's rough drafts of subnet create for OpenStack, IBM Cloud PowerVS, and nuage:

::CloudSubnet common:

[
  {
    :component => 'text-field',
    :id        => 'subnet_name',
    :name      => 'subnet_name',
    :label     => _('Subnet Name'),
  },
  {
    :component => 'text-field',
    :id        => 'subnet_cidr',
    :name      => 'subnet_cidr',
    :label     => _('Subnet CIDR'),
    :isRequired => true,
    :validate   => [{:type => 'required'}]
  },
  {
    :component => 'text-area',
    :id        => 'dns_servers',
    :name      => 'dns_servers',
    :label     => _('DNS Servers'),
  },
]

ManageIQ::Providers::IbmCloud::PowerVirtualServers::NetworkManager::CloudSubnet

[
  {
    :component => 'select',
    :name      => 'type',
    :id        => 'type',
    :label     => _('Type'),
    :options   => [
      {
        :label => 'vlan',
        :value => 'vlan',
      },
      {
        :label => 'pub-vlan',
        :value => 'pub-vlan',
      }
    ]
  },
  # TODO: Validate starting/Ending IP addresses must both be set or both be unset
  #       Use 'IP Address Ranges' subform?
  {
    :component => 'text-field',
    :id        => 'starting_ip_address',
    :name      => 'starting_ip_address',
    :label     => _('Starting IP Address'),
  },
  {
    :component => 'text-field',
    :id        => 'ending_ip_address',
    :name      => 'ending_ip_address',
    :label     => _('Ending IP Address'),
  },
  {
    :component => 'switch',
    :id        => 'jumbo',
    :name      => 'jumbo',
    :label     => _('MTU Jumbo Network'),
    :onText    => 'Enabled',
    :offText   => 'Disabled',
  },
]

ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet

[
  # Network Management Provider
  # TODO:  "Network Management Provider"
  {
    :component => 'select',
    :name      => 'cloud_tenant_placement',
    :id        => 'cloud_tenant_placement',
    :label     => _('Cloud Tenant Placement'),
    # TODO: Get list of tenents for selected network manager
    :options   => ems.tenants.map do |cvt|
      {
        :label => cvt.description,
        :value => cvt.name,
      }
    end,
  },
  # Cloud Subnet details
  {
    :component => 'select',
    :name      => 'network',
    :id        => 'network',
    :label     => _('Network'),
    # TODO: Get list of networks in selected network manager
    :options   => ems.networks.map do |cvt|
      {
        :label => cvt.description,
        :value => cvt.name,
      }
    end,
    :isRequired => true,
    :validate   => [{:type => 'required'}]
  },
  {
    :component => 'text-field',
    :id        => 'gateway',
    :name      => 'gateway',
    :label     => _('Gateway'),
  },
  {
    :component => 'switch',
    :id        => 'dhcp',
    :name      => 'dhcp',
    :label     => _('DHCP'),
    :onText    => 'Enabled',
    :offText   => 'Disabled',
  },
  {
    :component => 'select',
    :name      => 'ip_version',
    :id        => 'ip_version',
    :label     => _('IP Version'),
    :options   => [
      {
        :label => 'ipv4',
        :value => 'ipv4',
      },
      {
        :label => 'ipv6',
        :value => 'ipv6',
      }
    ]
  },
  {
    :component => 'text-area',
    :id        => 'allocation_pools',
    :name      => 'allocation_pools',
    :label     => _('Allocation Pools'),
  },
  {
    :component => 'text-area',
    :id        => 'host_routes',
    :name      => 'host_routes',
    :label     => _('Host Routes'),
  },
]

ManageIQ::Providers::Nuage::NetworkManager::CloudSubnet

[
  {
    :component => 'select',
    :name      => 'network',
    :id        => 'network',
    :label     => _('Network'),
    # TODO: Get list of networks in selected network manager
    :options   => ems.networks.map do |cvt|
      {
        :label => cvt.description,
        :value => cvt.name,
      }
    end,
    :isRequired => true,
    :validate   => [{:type => 'required'}]
  },
  {
    :component => 'text-field',
    :id        => 'gateway',
    :name      => 'gateway',
    :label     => _('Gateway'),
  },
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment