diff --git a/client/dhcpRelayGwExtIp_service.go b/client/dhcpRelayGwExtIp_service.go index 55e4db34..5622f602 100644 --- a/client/dhcpRelayGwExtIp_service.go +++ b/client/dhcpRelayGwExtIp_service.go @@ -6,13 +6,13 @@ import ( "github.com/ciscoecosystem/aci-go-client/v2/models" ) -func (sm *ServiceManager) CreateUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string, description string, dhcpRelayGwExtIpAttr models.UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes) (*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) { - dhcpRelayGwExtIp := models.NewUsetheexternalsecondaryaddressforDHCPrelaygateway(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr) +func (sm *ServiceManager) CreateDhcpRelayGwExtIp(parentDn string, description string, dhcpRelayGwExtIpAttr models.DhcpRelayGwExtIpAttributes) (*models.DhcpRelayGwExtIp, error) { + dhcpRelayGwExtIp := models.NewDhcpRelayGwExtIp(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr) err := sm.Save(dhcpRelayGwExtIp) return dhcpRelayGwExtIp, err } -func (sm *ServiceManager) ReadUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string) (*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) { +func (sm *ServiceManager) ReadDhcpRelayGwExtIp(parentDn string) (*models.DhcpRelayGwExtIp, error) { dn := fmt.Sprintf("%s/%s", parentDn, models.RndhcpRelayGwExtIp) cont, err := sm.Get(dn) @@ -20,25 +20,25 @@ func (sm *ServiceManager) ReadUsetheexternalsecondaryaddressforDHCPrelaygateway( return nil, err } - dhcpRelayGwExtIp := models.UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainer(cont) + dhcpRelayGwExtIp := models.DhcpRelayGwExtIpFromContainer(cont) return dhcpRelayGwExtIp, nil } -func (sm *ServiceManager) DeleteUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string) error { +func (sm *ServiceManager) DeleteDhcpRelayGwExtIp(parentDn string) error { dn := fmt.Sprintf("%s/%s", parentDn, models.RndhcpRelayGwExtIp) return sm.DeleteByDn(dn, models.DhcprelaygwextipClassName) } -func (sm *ServiceManager) UpdateUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string, description string, dhcpRelayGwExtIpAttr models.UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes) (*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) { - dhcpRelayGwExtIp := models.NewUsetheexternalsecondaryaddressforDHCPrelaygateway(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr) +func (sm *ServiceManager) UpdateDhcpRelayGwExtIp(parentDn string, description string, dhcpRelayGwExtIpAttr models.DhcpRelayGwExtIpAttributes) (*models.DhcpRelayGwExtIp, error) { + dhcpRelayGwExtIp := models.NewDhcpRelayGwExtIp(models.RndhcpRelayGwExtIp, parentDn, description, dhcpRelayGwExtIpAttr) dhcpRelayGwExtIp.Status = "modified" err := sm.Save(dhcpRelayGwExtIp) return dhcpRelayGwExtIp, err } -func (sm *ServiceManager) ListUsetheexternalsecondaryaddressforDHCPrelaygateway(parentDn string) ([]*models.UsetheexternalsecondaryaddressforDHCPrelaygateway, error) { +func (sm *ServiceManager) ListDhcpRelayGwExtIp(parentDn string) ([]*models.DhcpRelayGwExtIp, error) { dnUrl := fmt.Sprintf("%s/%s/dhcpRelayGwExtIp.json", models.BaseurlStr, parentDn) cont, err := sm.GetViaURL(dnUrl) - list := models.UsetheexternalsecondaryaddressforDHCPrelaygatewayListFromContainer(cont) + list := models.DhcpRelayGwExtIpListFromContainer(cont) return list, err } diff --git a/models/dhcp_relay_gw_ext_ip.go b/models/dhcp_relay_gw_ext_ip.go index 2b1d0bcc..b708bb70 100644 --- a/models/dhcp_relay_gw_ext_ip.go +++ b/models/dhcp_relay_gw_ext_ip.go @@ -12,18 +12,18 @@ const ( DhcprelaygwextipClassName = "dhcpRelayGwExtIp" ) -type UsetheexternalsecondaryaddressforDHCPrelaygateway struct { +type DhcpRelayGwExtIp struct { BaseAttributes - UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes + DhcpRelayGwExtIpAttributes } -type UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes struct { +type DhcpRelayGwExtIpAttributes struct { Name string `json:",omitempty"` } -func NewUsetheexternalsecondaryaddressforDHCPrelaygateway(dhcpRelayGwExtIpRn, parentDn, description string, dhcpRelayGwExtIpAttr UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes) *UsetheexternalsecondaryaddressforDHCPrelaygateway { +func NewDhcpRelayGwExtIp(dhcpRelayGwExtIpRn, parentDn, description string, dhcpRelayGwExtIpAttr DhcpRelayGwExtIpAttributes) *DhcpRelayGwExtIp { dn := fmt.Sprintf("%s/%s", parentDn, dhcpRelayGwExtIpRn) - return &UsetheexternalsecondaryaddressforDHCPrelaygateway{ + return &DhcpRelayGwExtIp{ BaseAttributes: BaseAttributes{ DistinguishedName: dn, Description: description, @@ -31,11 +31,11 @@ func NewUsetheexternalsecondaryaddressforDHCPrelaygateway(dhcpRelayGwExtIpRn, pa ClassName: DhcprelaygwextipClassName, Rn: dhcpRelayGwExtIpRn, }, - UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes: dhcpRelayGwExtIpAttr, + DhcpRelayGwExtIpAttributes: dhcpRelayGwExtIpAttr, } } -func (dhcpRelayGwExtIp *UsetheexternalsecondaryaddressforDHCPrelaygateway) ToMap() (map[string]string, error) { +func (dhcpRelayGwExtIp *DhcpRelayGwExtIp) ToMap() (map[string]string, error) { dhcpRelayGwExtIpMap, err := dhcpRelayGwExtIp.BaseAttributes.ToMap() if err != nil { return nil, err @@ -45,32 +45,32 @@ func (dhcpRelayGwExtIp *UsetheexternalsecondaryaddressforDHCPrelaygateway) ToMap return dhcpRelayGwExtIpMap, err } -func UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainerList(cont *container.Container, index int) *UsetheexternalsecondaryaddressforDHCPrelaygateway { - UsetheexternalsecondaryaddressforDHCPrelaygatewayCont := cont.S("imdata").Index(index).S(DhcprelaygwextipClassName, "attributes") - return &UsetheexternalsecondaryaddressforDHCPrelaygateway{ +func DhcpRelayGwExtIpFromContainerList(cont *container.Container, index int) *DhcpRelayGwExtIp { + DhcpRelayGwExtIpCont := cont.S("imdata").Index(index).S(DhcprelaygwextipClassName, "attributes") + return &DhcpRelayGwExtIp{ BaseAttributes{ - DistinguishedName: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "dn"), - Description: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "descr"), - Status: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "status"), + DistinguishedName: G(DhcpRelayGwExtIpCont, "dn"), + Description: G(DhcpRelayGwExtIpCont, "descr"), + Status: G(DhcpRelayGwExtIpCont, "status"), ClassName: DhcprelaygwextipClassName, - Rn: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "rn"), + Rn: G(DhcpRelayGwExtIpCont, "rn"), }, - UsetheexternalsecondaryaddressforDHCPrelaygatewayAttributes{ - Name: G(UsetheexternalsecondaryaddressforDHCPrelaygatewayCont, "name"), + DhcpRelayGwExtIpAttributes{ + Name: G(DhcpRelayGwExtIpCont, "name"), }, } } -func UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainer(cont *container.Container) *UsetheexternalsecondaryaddressforDHCPrelaygateway { - return UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainerList(cont, 0) +func DhcpRelayGwExtIpFromContainer(cont *container.Container) *DhcpRelayGwExtIp { + return DhcpRelayGwExtIpFromContainerList(cont, 0) } -func UsetheexternalsecondaryaddressforDHCPrelaygatewayListFromContainer(cont *container.Container) []*UsetheexternalsecondaryaddressforDHCPrelaygateway { +func DhcpRelayGwExtIpListFromContainer(cont *container.Container) []*DhcpRelayGwExtIp { length, _ := strconv.Atoi(G(cont, "totalCount")) - arr := make([]*UsetheexternalsecondaryaddressforDHCPrelaygateway, length) + arr := make([]*DhcpRelayGwExtIp, length) for i := 0; i < length; i++ { - arr[i] = UsetheexternalsecondaryaddressforDHCPrelaygatewayFromContainerList(cont, i) + arr[i] = DhcpRelayGwExtIpFromContainerList(cont, i) } return arr