Skip to content

Commit

Permalink
[minor_change] Add cloudRegionName, cloudtemplateBgpIpv4, cloudtempla…
Browse files Browse the repository at this point in the history
…teIpSecTunnel, cloudtemplateIpSecTunnelSourceInterface, cloudtemplateIpSecTunnelSubnetPool and cloudtemplateVpnNetwork model and client files and add VpnRouterName attribute to cloudtemplateExtNetwork.
  • Loading branch information
anvitha-jain authored Nov 16, 2022
1 parent e1f9208 commit 0fb4766
Show file tree
Hide file tree
Showing 14 changed files with 813 additions and 2 deletions.
47 changes: 47 additions & 0 deletions client/cloudRegionName_service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package client

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateCloudProviderandRegionNames(region string, provider string, template_for_external_network string, infra_network_template string, tenant string, cloudRegionNameAttr models.CloudProviderandRegionNamesAttributes) (*models.CloudProviderandRegionNames, error) {
rn := fmt.Sprintf(models.RncloudRegionName, provider, region)
parentDn := fmt.Sprintf(models.ParentDncloudRegionName, tenant, infra_network_template, template_for_external_network)
cloudRegionName := models.NewCloudProviderandRegionNames(rn, parentDn, cloudRegionNameAttr)
err := sm.Save(cloudRegionName)
return cloudRegionName, err
}

func (sm *ServiceManager) ReadCloudProviderandRegionNames(region string, provider string, template_for_external_network string, infra_network_template string, tenant string) (*models.CloudProviderandRegionNames, error) {
dn := fmt.Sprintf(models.DncloudRegionName, tenant, infra_network_template, template_for_external_network, provider, region)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

cloudRegionName := models.CloudProviderandRegionNamesFromContainer(cont)
return cloudRegionName, nil
}

func (sm *ServiceManager) DeleteCloudProviderandRegionNames(dn string) error {
return sm.DeleteByDn(dn, models.CloudregionnameClassName)
}

func (sm *ServiceManager) UpdateCloudProviderandRegionNames(region string, provider string, template_for_external_network string, infra_network_template string, tenant string, cloudRegionNameAttr models.CloudProviderandRegionNamesAttributes) (*models.CloudProviderandRegionNames, error) {
rn := fmt.Sprintf(models.RncloudRegionName, provider, region)
parentDn := fmt.Sprintf(models.ParentDncloudRegionName, tenant, infra_network_template, template_for_external_network)
cloudRegionName := models.NewCloudProviderandRegionNames(rn, parentDn, cloudRegionNameAttr)
cloudRegionName.Status = "modified"
err := sm.Save(cloudRegionName)
return cloudRegionName, err
}

func (sm *ServiceManager) ListCloudProviderandRegionNames(parentDn string) ([]*models.CloudProviderandRegionNames, error) {
dnUrl := fmt.Sprintf("%s/%s/cloudRegionName.json", models.BaseurlStr, parentDn)
cont, err := sm.GetViaURL(dnUrl)
list := models.CloudProviderandRegionNamesListFromContainer(cont)
return list, err
}
48 changes: 48 additions & 0 deletions client/cloudtemplateBgpIpv4_service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package client

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateCloudTemplateBGPIPv4Peer(peeraddr string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string, cloudtemplateBgpIpv4Attr models.CloudTemplateBGPIPv4PeerAttributes) (*models.CloudTemplateBGPIPv4Peer, error) {
rn := fmt.Sprintf(models.RncloudtemplateBgpIpv4, peeraddr)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateBgpIpv4, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr)
cloudtemplateBgpIpv4 := models.NewCloudTemplateBGPIPv4Peer(rn, parentDn, cloudtemplateBgpIpv4Attr)
err := sm.Save(cloudtemplateBgpIpv4)
return cloudtemplateBgpIpv4, err
}

func (sm *ServiceManager) ReadCloudTemplateBGPIPv4Peer(peeraddr string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string) (*models.CloudTemplateBGPIPv4Peer, error) {
dn := fmt.Sprintf(models.DncloudtemplateBgpIpv4, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr, peeraddr)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

cloudtemplateBgpIpv4 := models.CloudTemplateBGPIPv4PeerFromContainer(cont)
return cloudtemplateBgpIpv4, nil
}

func (sm *ServiceManager) DeleteCloudTemplateBGPIPv4Peer(peeraddr string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string) error {
dn := fmt.Sprintf(models.DncloudtemplateBgpIpv4, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr, peeraddr)
return sm.DeleteByDn(dn, models.Cloudtemplatebgpipv4ClassName)
}

func (sm *ServiceManager) UpdateCloudTemplateBGPIPv4Peer(peeraddr string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string, cloudtemplateBgpIpv4Attr models.CloudTemplateBGPIPv4PeerAttributes) (*models.CloudTemplateBGPIPv4Peer, error) {
rn := fmt.Sprintf(models.RncloudtemplateBgpIpv4, peeraddr)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateBgpIpv4, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr)
cloudtemplateBgpIpv4 := models.NewCloudTemplateBGPIPv4Peer(rn, parentDn, cloudtemplateBgpIpv4Attr)
cloudtemplateBgpIpv4.Status = "modified"
err := sm.Save(cloudtemplateBgpIpv4)
return cloudtemplateBgpIpv4, err
}

func (sm *ServiceManager) ListCloudTemplateBGPIPv4Peer(parentDn string) ([]*models.CloudTemplateBGPIPv4Peer, error) {
dnUrl := fmt.Sprintf("%s/%s/cloudtemplateBgpIpv4.json", models.BaseurlStr, parentDn)
cont, err := sm.GetViaURL(dnUrl)
list := models.CloudTemplateBGPIPv4PeerListFromContainer(cont)
return list, err
}
4 changes: 2 additions & 2 deletions client/cloudtemplateExtNetwork_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func (sm *ServiceManager) ReadCloudTemplateforExternalNetwork(name string, infra
return cloudtemplateExtNetwork, nil
}

func (sm *ServiceManager) DeleteCloudTemplateforExternalNetwork(name string, infra_network_template string, tenant string) error {
dn := fmt.Sprintf(models.DncloudtemplateExtNetwork, tenant, infra_network_template, name)
func (sm *ServiceManager) DeleteCloudTemplateforExternalNetwork(cloudtemplateExtNetworkRn string, parentDn string) error {
dn := fmt.Sprintf("%s/%s", parentDn, cloudtemplateExtNetworkRn)
return sm.DeleteByDn(dn, models.CloudtemplateextnetworkClassName)
}

Expand Down
48 changes: 48 additions & 0 deletions client/cloudtemplateIpSecTunnelSourceInterface_service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package client

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateCloudTemplateforIpSectunnelSourceInterface(sourceInterfaceId string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string, cloudtemplateIpSecTunnelSourceInterfaceAttr models.CloudTemplateforIpSectunnelSourceInterfaceAttributes) (*models.CloudTemplateforIpSectunnelSourceInterface, error) {
rn := fmt.Sprintf(models.RncloudtemplateIpSecTunnelSourceInterface, sourceInterfaceId)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateIpSecTunnelSourceInterface, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr)
cloudtemplateIpSecTunnelSourceInterface := models.NewCloudTemplateIpSecTunnelSourceInterface(rn, parentDn, cloudtemplateIpSecTunnelSourceInterfaceAttr)
err := sm.Save(cloudtemplateIpSecTunnelSourceInterface)
return cloudtemplateIpSecTunnelSourceInterface, err
}

func (sm *ServiceManager) ReadCloudTemplateforIpSectunnelSourceInterface(sourceInterfaceId string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string) (*models.CloudTemplateforIpSectunnelSourceInterface, error) {
dn := fmt.Sprintf(models.DncloudtemplateIpSecTunnelSourceInterface, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr, sourceInterfaceId)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

cloudtemplateIpSecTunnelSourceInterface := models.CloudTemplateIpSecTunnelSourceInterfaceFromContainer(cont)
return cloudtemplateIpSecTunnelSourceInterface, nil
}

func (sm *ServiceManager) DeleteCloudTemplateforIpSectunnelSourceInterface(sourceInterfaceId string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string) error {
dn := fmt.Sprintf(models.DncloudtemplateIpSecTunnelSourceInterface, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr, sourceInterfaceId)
return sm.DeleteByDn(dn, models.CloudtemplateipsectunnelsourceinterfaceClassName)
}

func (sm *ServiceManager) UpdateCloudTemplateforIpSectunnelSourceInterface(sourceInterfaceId string, template_for_ipsec_tunnel_peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string, cloudtemplateIpSecTunnelSourceInterfaceAttr models.CloudTemplateforIpSectunnelSourceInterfaceAttributes) (*models.CloudTemplateforIpSectunnelSourceInterface, error) {
rn := fmt.Sprintf(models.RncloudtemplateIpSecTunnelSourceInterface, sourceInterfaceId)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateIpSecTunnelSourceInterface, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, template_for_ipsec_tunnel_peeraddr)
cloudtemplateIpSecTunnelSourceInterface := models.NewCloudTemplateIpSecTunnelSourceInterface(rn, parentDn, cloudtemplateIpSecTunnelSourceInterfaceAttr)
cloudtemplateIpSecTunnelSourceInterface.Status = "modified"
err := sm.Save(cloudtemplateIpSecTunnelSourceInterface)
return cloudtemplateIpSecTunnelSourceInterface, err
}

func (sm *ServiceManager) ListCloudTemplateforIpSectunnelSourceInterface(parentDn string) ([]*models.CloudTemplateforIpSectunnelSourceInterface, error) {
dnUrl := fmt.Sprintf("%s/%s/cloudtemplateIpSecTunnelSourceInterface.json", models.BaseurlStr, parentDn)
cont, err := sm.GetViaURL(dnUrl)
list := models.CloudTemplateIpSecTunnelSourceInterfaceListFromContainer(cont)
return list, err
}
48 changes: 48 additions & 0 deletions client/cloudtemplateIpSecTunnelSubnetPool_service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package client

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateSubnetPoolforIpSecTunnels(subnetpool string, infra_network_template string, tenant string, cloudtemplateIpSecTunnelSubnetPoolAttr models.SubnetPoolforIpSecTunnelsAttributes) (*models.SubnetPoolforIpSecTunnels, error) {
rn := fmt.Sprintf(models.RncloudtemplateIpSecTunnelSubnetPool, subnetpool)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateIpSecTunnelSubnetPool, tenant, infra_network_template)
cloudtemplateIpSecTunnelSubnetPool := models.NewSubnetPoolforIpSecTunnels(rn, parentDn, cloudtemplateIpSecTunnelSubnetPoolAttr)
err := sm.Save(cloudtemplateIpSecTunnelSubnetPool)
return cloudtemplateIpSecTunnelSubnetPool, err
}

func (sm *ServiceManager) ReadSubnetPoolforIpSecTunnels(subnetpool string, infra_network_template string, tenant string) (*models.SubnetPoolforIpSecTunnels, error) {
dn := fmt.Sprintf(models.DncloudtemplateIpSecTunnelSubnetPool, tenant, infra_network_template, subnetpool)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

cloudtemplateIpSecTunnelSubnetPool := models.SubnetPoolforIpSecTunnelsFromContainer(cont)
return cloudtemplateIpSecTunnelSubnetPool, nil
}

func (sm *ServiceManager) DeleteSubnetPoolforIpSecTunnels(subnetpool string, infra_network_template string, tenant string) error {
dn := fmt.Sprintf(models.DncloudtemplateIpSecTunnelSubnetPool, tenant, infra_network_template, subnetpool)
return sm.DeleteByDn(dn, models.CloudtemplateipsectunnelsubnetpoolClassName)
}

func (sm *ServiceManager) UpdateSubnetPoolforIpSecTunnels(subnetpool string, infra_network_template string, tenant string, cloudtemplateIpSecTunnelSubnetPoolAttr models.SubnetPoolforIpSecTunnelsAttributes) (*models.SubnetPoolforIpSecTunnels, error) {
rn := fmt.Sprintf(models.RncloudtemplateIpSecTunnelSubnetPool, subnetpool)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateIpSecTunnelSubnetPool, tenant, infra_network_template)
cloudtemplateIpSecTunnelSubnetPool := models.NewSubnetPoolforIpSecTunnels(rn, parentDn, cloudtemplateIpSecTunnelSubnetPoolAttr)
cloudtemplateIpSecTunnelSubnetPool.Status = "modified"
err := sm.Save(cloudtemplateIpSecTunnelSubnetPool)
return cloudtemplateIpSecTunnelSubnetPool, err
}

func (sm *ServiceManager) ListSubnetPoolforIpSecTunnels(infra_network_template string, tenant string) ([]*models.SubnetPoolforIpSecTunnels, error) {
dnUrl := fmt.Sprintf("%s/uni/tn-%s/infranetwork-%s/cloudtemplateIpSecTunnelSubnetPool.json", models.BaseurlStr, tenant, infra_network_template)
cont, err := sm.GetViaURL(dnUrl)
list := models.SubnetPoolforIpSecTunnelsListFromContainer(cont)
return list, err
}
48 changes: 48 additions & 0 deletions client/cloudtemplateIpSecTunnel_service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package client

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateCloudTemplateforIpSectunnel(peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string, cloudtemplateIpSecTunnelAttr models.CloudTemplateforIpSectunnelAttributes) (*models.CloudTemplateforIpSectunnel, error) {
rn := fmt.Sprintf(models.RncloudtemplateIpSecTunnel, peeraddr)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateIpSecTunnel, tenant, infra_network_template, template_for_external_network, template_for_vpn_network)
cloudtemplateIpSecTunnel := models.NewCloudTemplateforIpSectunnel(rn, parentDn, cloudtemplateIpSecTunnelAttr)
err := sm.Save(cloudtemplateIpSecTunnel)
return cloudtemplateIpSecTunnel, err
}

func (sm *ServiceManager) ReadCloudTemplateforIpSectunnel(peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string) (*models.CloudTemplateforIpSectunnel, error) {
dn := fmt.Sprintf(models.DncloudtemplateIpSecTunnel, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, peeraddr)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

cloudtemplateIpSecTunnel := models.CloudTemplateforIpSectunnelFromContainer(cont)
return cloudtemplateIpSecTunnel, nil
}

func (sm *ServiceManager) DeleteCloudTemplateforIpSectunnel(peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string) error {
dn := fmt.Sprintf(models.DncloudtemplateIpSecTunnel, tenant, infra_network_template, template_for_external_network, template_for_vpn_network, peeraddr)
return sm.DeleteByDn(dn, models.CloudtemplateipsectunnelClassName)
}

func (sm *ServiceManager) UpdateCloudTemplateforIpSectunnel(peeraddr string, template_for_vpn_network string, template_for_external_network string, infra_network_template string, tenant string, cloudtemplateIpSecTunnelAttr models.CloudTemplateforIpSectunnelAttributes) (*models.CloudTemplateforIpSectunnel, error) {
rn := fmt.Sprintf(models.RncloudtemplateIpSecTunnel, peeraddr)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateIpSecTunnel, tenant, infra_network_template, template_for_external_network, template_for_vpn_network)
cloudtemplateIpSecTunnel := models.NewCloudTemplateforIpSectunnel(rn, parentDn, cloudtemplateIpSecTunnelAttr)
cloudtemplateIpSecTunnel.Status = "modified"
err := sm.Save(cloudtemplateIpSecTunnel)
return cloudtemplateIpSecTunnel, err
}

func (sm *ServiceManager) ListCloudTemplateforIpSectunnel(parentDn string) ([]*models.CloudTemplateforIpSectunnel, error) {
dnUrl := fmt.Sprintf("%s/%s/cloudtemplateIpSecTunnel.json", models.BaseurlStr, parentDn)
cont, err := sm.GetViaURL(dnUrl)
list := models.CloudTemplateforIpSectunnelListFromContainer(cont)
return list, err
}
48 changes: 48 additions & 0 deletions client/cloudtemplateVpnNetwork_service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package client

import (
"fmt"

"github.com/ciscoecosystem/aci-go-client/v2/models"
)

func (sm *ServiceManager) CreateCloudTemplateforVPNNetwork(name string, template_for_external_network string, infra_network_template string, tenant string, nameAlias string, cloudtemplateVpnNetworkAttr models.CloudTemplateforVPNNetworkAttributes) (*models.CloudTemplateforVPNNetwork, error) {
rn := fmt.Sprintf(models.RncloudtemplateVpnNetwork, name)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateVpnNetwork, tenant, infra_network_template, template_for_external_network)
cloudtemplateVpnNetwork := models.NewCloudTemplateforVPNNetwork(rn, parentDn, nameAlias, cloudtemplateVpnNetworkAttr)
err := sm.Save(cloudtemplateVpnNetwork)
return cloudtemplateVpnNetwork, err
}

func (sm *ServiceManager) ReadCloudTemplateforVPNNetwork(name string, template_for_external_network string, infra_network_template string, tenant string) (*models.CloudTemplateforVPNNetwork, error) {
dn := fmt.Sprintf(models.DncloudtemplateVpnNetwork, tenant, infra_network_template, template_for_external_network, name)

cont, err := sm.Get(dn)
if err != nil {
return nil, err
}

cloudtemplateVpnNetwork := models.CloudTemplateforVPNNetworkFromContainer(cont)
return cloudtemplateVpnNetwork, nil
}

func (sm *ServiceManager) DeleteCloudTemplateforVPNNetwork(name string, template_for_external_network string, infra_network_template string, tenant string) error {
dn := fmt.Sprintf(models.DncloudtemplateVpnNetwork, tenant, infra_network_template, template_for_external_network, name)
return sm.DeleteByDn(dn, models.CloudtemplatevpnnetworkClassName)
}

func (sm *ServiceManager) UpdateCloudTemplateforVPNNetwork(name string, template_for_external_network string, infra_network_template string, tenant string, nameAlias string, cloudtemplateVpnNetworkAttr models.CloudTemplateforVPNNetworkAttributes) (*models.CloudTemplateforVPNNetwork, error) {
rn := fmt.Sprintf(models.RncloudtemplateVpnNetwork, name)
parentDn := fmt.Sprintf(models.ParentDncloudtemplateVpnNetwork, tenant, infra_network_template, template_for_external_network)
cloudtemplateVpnNetwork := models.NewCloudTemplateforVPNNetwork(rn, parentDn, nameAlias, cloudtemplateVpnNetworkAttr)
cloudtemplateVpnNetwork.Status = "modified"
err := sm.Save(cloudtemplateVpnNetwork)
return cloudtemplateVpnNetwork, err
}

func (sm *ServiceManager) ListCloudTemplateforVPNNetwork(template_for_external_network string, infra_network_template string, tenant string) ([]*models.CloudTemplateforVPNNetwork, error) {
dnUrl := fmt.Sprintf("%s/uni/tn-%s/infranetwork-%s/extnetwork-%s/cloudtemplateVpnNetwork.json", models.BaseurlStr, tenant, infra_network_template, template_for_external_network)
cont, err := sm.GetViaURL(dnUrl)
list := models.CloudTemplateforVPNNetworkListFromContainer(cont)
return list, err
}
Loading

0 comments on commit 0fb4766

Please sign in to comment.