diff --git a/aci/data_source_aci_fabricpathep.go b/aci/data_source_aci_fabricpathep.go new file mode 100644 index 000000000..77394dcc2 --- /dev/null +++ b/aci/data_source_aci_fabricpathep.go @@ -0,0 +1,82 @@ +package aci + +import ( + "fmt" + + "github.com/ciscoecosystem/aci-go-client/client" + "github.com/ciscoecosystem/aci-go-client/models" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAciFabricPathEndpoint() *schema.Resource { + return &schema.Resource{ + + Read: dataSourceAciFabricPathEndpointRead, + + SchemaVersion: 1, + + Schema: AppendBaseAttrSchema(map[string]*schema.Schema{ + "pod_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + + "node_id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + }), + } +} + +func getRemoteFabricPathEndpoint(client *client.Client, dn string) (*models.FabricPathEndpoint, error) { + fabricPathEpCont, err := client.Get(dn) + if err != nil { + return nil, err + } + + fabricPathEp := models.FabricPathEndpointFromContainer(fabricPathEpCont) + + if fabricPathEp.DistinguishedName == "" { + return nil, fmt.Errorf("FabricPathEndpoint %s not found", fabricPathEp.DistinguishedName) + } + + return fabricPathEp, nil +} + +func setFabricPathEndpointAttributes(fabricPathEp *models.FabricPathEndpoint, d *schema.ResourceData) *schema.ResourceData { + d.SetId(fabricPathEp.DistinguishedName) + d.Set("description", fabricPathEp.Description) + + fabricPathEpMap, _ := fabricPathEp.ToMap() + d.Set("name", fabricPathEpMap["name"]) + + return d +} + +func dataSourceAciFabricPathEndpointRead(d *schema.ResourceData, m interface{}) error { + aciClient := m.(*client.Client) + + name := d.Get("name").(string) + podID := d.Get("pod_id").(string) + nodeID := d.Get("node_id").(string) + + pDN := fmt.Sprintf("topology/pod-%s/paths-%s", podID, nodeID) + + rn := fmt.Sprintf("pathep-[%s]", name) + + dn := fmt.Sprintf("%s/%s", pDN, rn) + + fabricPathEp, err := getRemoteFabricPathEndpoint(aciClient, dn) + if err != nil { + return err + } + + setFabricPathEndpointAttributes(fabricPathEp, d) + return nil +} diff --git a/aci/provider.go b/aci/provider.go index b813e8bb4..66debe4d6 100644 --- a/aci/provider.go +++ b/aci/provider.go @@ -250,6 +250,7 @@ func Provider() terraform.ResourceProvider { "aci_spine_port_selector": dataSourceAciInterfaceProfile(), "aci_spine_interface_profile": dataSourceAciSpineInterfaceProfile(), "aci_spine_port_policy_group": dataSourceAciSpineAccessPortPolicyGroup(), + "aci_fabric_path_ep": dataSourceAciFabricPathEndpoint(), }, ConfigureFunc: configureClient, diff --git a/aci/resource_aci_vzbrcp.go b/aci/resource_aci_vzbrcp.go index 37279b292..52f0b7df9 100644 --- a/aci/resource_aci_vzbrcp.go +++ b/aci/resource_aci_vzbrcp.go @@ -213,16 +213,6 @@ func resourceAciContract() *schema.Resource { } return false }, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "d_to_port": &schema.Schema{ @@ -248,16 +238,6 @@ func resourceAciContract() *schema.Resource { } return false }, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "ether_t": &schema.Schema{ @@ -387,16 +367,6 @@ func resourceAciContract() *schema.Resource { } return false }, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "s_to_port": &schema.Schema{ @@ -422,16 +392,6 @@ func resourceAciContract() *schema.Resource { } return false }, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "stateful": &schema.Schema{ diff --git a/aci/resource_aci_vzentry.go b/aci/resource_aci_vzentry.go index e73800b07..06d929238 100644 --- a/aci/resource_aci_vzentry.go +++ b/aci/resource_aci_vzentry.go @@ -61,32 +61,12 @@ func resourceAciFilterEntry() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "d_to_port": &schema.Schema{ Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "ether_t": &schema.Schema{ @@ -197,32 +177,12 @@ func resourceAciFilterEntry() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "s_to_port": &schema.Schema{ Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "unspecified", - "ftpData", - "smtp", - "dns", - "http", - "pop3", - "https", - "rtsp", - }, false), }, "stateful": &schema.Schema{ diff --git a/go.mod b/go.mod index ac447aa06..5d95a0a08 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aci go 1.12 require ( - github.com/ciscoecosystem/aci-go-client v0.4.20 + github.com/ciscoecosystem/aci-go-client v0.5.11 github.com/ghodss/yaml v1.0.0 github.com/hashicorp/terraform-plugin-sdk v1.14.0 github.com/hashicorp/terraform-plugin-test v1.4.3 // indirect diff --git a/go.sum b/go.sum index 6ba53a3ba..82715944f 100644 --- a/go.sum +++ b/go.sum @@ -120,6 +120,12 @@ github.com/ciscoecosystem/aci-go-client v0.5.7 h1:sXYYvpbvl7tTu8icpWYfq0A+Isnqmv github.com/ciscoecosystem/aci-go-client v0.5.7/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= github.com/ciscoecosystem/aci-go-client v0.5.8 h1:ZpcqZBEiJJy6QEyAZeK1sdoBfG+W0OSwCyGAavHgA/4= github.com/ciscoecosystem/aci-go-client v0.5.8/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= +github.com/ciscoecosystem/aci-go-client v0.5.9 h1:aZoBr6wUFzbZJIfzrLE+VK7W6e3TsSI+PSxKe5UegCs= +github.com/ciscoecosystem/aci-go-client v0.5.9/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= +github.com/ciscoecosystem/aci-go-client v0.5.10 h1:4WzzfnlQsMlbddxJJCuXFZxeWFSzNILF1ICBKv5MR/0= +github.com/ciscoecosystem/aci-go-client v0.5.10/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= +github.com/ciscoecosystem/aci-go-client v0.5.11 h1:3Zoo+VRwzvkPuJDGdAAW5tT/wawgIzW+Vs4RGrXvx8Q= +github.com/ciscoecosystem/aci-go-client v0.5.11/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= github.com/ciscoecosystem/aci-go-client v1.0.0 h1:mTFw2AJBbUAVDd8OETQd0jD9EEJYv+a5bnXNskc46SY= github.com/ciscoecosystem/aci-go-client v1.0.0/go.mod h1:jFrITzPN2qjycddQVHNFIDOe3rvR00YCdkPK7N24vkM= github.com/ciscoecosystem/aci-go-client v1.0.1 h1:hemK22oIvaiA8KIpPp38z533qtlJvk0ujvCIagII+fs= @@ -174,6 +180,8 @@ github.com/ciscoecosystem/aci-go-client v1.3.4-0.20200716070731-3c5343020306 h1: github.com/ciscoecosystem/aci-go-client v1.3.4-0.20200716070731-3c5343020306/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= github.com/ciscoecosystem/aci-go-client v1.3.4 h1:+ZPRDoIxTsBBy+zWjcWKgNnXrNH9CgwKMZb84n9Rm1w= github.com/ciscoecosystem/aci-go-client v1.3.4/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= +github.com/ciscoecosystem/aci-go-client v1.3.8 h1:hqOgPGGzfjsXQHNueKXCQsmvrE/gUiWs9JAAbCHcayA= +github.com/ciscoecosystem/aci-go-client v1.3.8/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/client/auth.go b/vendor/github.com/ciscoecosystem/aci-go-client/client/auth.go index f7c4b9cb6..c25e7c5c8 100644 --- a/vendor/github.com/ciscoecosystem/aci-go-client/client/auth.go +++ b/vendor/github.com/ciscoecosystem/aci-go-client/client/auth.go @@ -14,12 +14,9 @@ import ( "log" "net/http" "os" - "sync" "time" ) -var l sync.Mutex - type Auth struct { Token string Expiry time.Time @@ -48,8 +45,8 @@ func (t *Auth) estimateExpireTime() int64 { func (client *Client) InjectAuthenticationHeader(req *http.Request, path string) (*http.Request, error) { log.Printf("[DEBUG] Begin Injection") - l.Lock() - defer l.Unlock() + client.l.Lock() + defer client.l.Unlock() if client.password != "" { if client.AuthToken == nil || !client.AuthToken.IsValid() { err := client.Authenticate() diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/client/client.go b/vendor/github.com/ciscoecosystem/aci-go-client/client/client.go index 368113aed..1c7237f9f 100644 --- a/vendor/github.com/ciscoecosystem/aci-go-client/client/client.go +++ b/vendor/github.com/ciscoecosystem/aci-go-client/client/client.go @@ -11,6 +11,7 @@ import ( "net/url" "strconv" "strings" + "sync" "time" "github.com/ciscoecosystem/aci-go-client/container" @@ -25,6 +26,10 @@ const authPayload = `{ } }` +// Default timeout for NGINX in ACI is 90 Seconds. +// Allow the client to set a shorter or longer time depending on their +// environment +const DefaultReqTimeoutVal uint32 = 100 const DefaultMOURL = "/api/node/mo" // Client is the main entry point @@ -33,11 +38,14 @@ type Client struct { MOURL string httpClient *http.Client AuthToken *Auth + l sync.Mutex username string password string privatekey string adminCert string insecure bool + reqTimeoutSet bool + reqTimeoutVal uint32 proxyUrl string skipLoggingPayload bool *ServiceManager @@ -90,6 +98,13 @@ func SkipLoggingPayload(skipLoggingPayload bool) Option { } } +func ReqTimeout(timeout uint32) Option { + return func(client *Client) { + client.reqTimeoutSet = true + client.reqTimeoutVal = timeout + } +} + func initClient(clientUrl, username string, options ...Option) *Client { var transport *http.Transport bUrl, err := url.Parse(clientUrl) @@ -117,6 +132,14 @@ func initClient(clientUrl, username string, options ...Option) *Client { Transport: transport, } + var timeout time.Duration + if client.reqTimeoutSet { + timeout = time.Second * time.Duration(client.reqTimeoutVal) + } else { + timeout = time.Second * time.Duration(DefaultReqTimeoutVal) + } + + client.httpClient.Timeout = timeout client.ServiceManager = NewServiceManager(client.MOURL, client) return client } @@ -164,6 +187,7 @@ func (c *Client) configProxy(transport *http.Transport) *http.Transport { return transport } + func (c *Client) useInsecureHTTPClient(insecure bool) *http.Transport { // proxyUrl, _ := url.Parse("http://10.0.1.167:3128") transport := &http.Transport{ @@ -242,6 +266,10 @@ func (c *Client) Authenticate() error { if obj == nil { return errors.New("Empty response") } + err = CheckForErrors(obj, method) + if err != nil { + return err + } token := obj.S("imdata").Index(0).S("aaaLogin", "attributes", "token").String() creationTimeStr := stripQuotes(obj.S("imdata").Index(0).S("aaaLogin", "attributes", "creationTime").String()) diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/client/fabricPathEp_service.go b/vendor/github.com/ciscoecosystem/aci-go-client/client/fabricPathEp_service.go new file mode 100644 index 000000000..0cc2d8830 --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/client/fabricPathEp_service.go @@ -0,0 +1,53 @@ +package client + +import ( + "fmt" + + "github.com/ciscoecosystem/aci-go-client/models" +) + +func (sm *ServiceManager) CreateFabricPathEndpoint(name string, fabric_path_end_point_container_nodeId string, fabric_pod_id string, description string, fabricPathEpattr models.FabricPathEndpointAttributes) (*models.FabricPathEndpoint, error) { + rn := fmt.Sprintf("pathep-[%s]", name) + parentDn := fmt.Sprintf("uni/topology/pod-%s/paths-%s", fabric_pod_id, fabric_path_end_point_container_nodeId) + fabricPathEp := models.NewFabricPathEndpoint(rn, parentDn, description, fabricPathEpattr) + err := sm.Save(fabricPathEp) + return fabricPathEp, err +} + +func (sm *ServiceManager) ReadFabricPathEndpoint(name string, fabric_path_end_point_container_nodeId string, fabric_pod_id string) (*models.FabricPathEndpoint, error) { + dn := fmt.Sprintf("uni/topology/pod-%s/paths-%s/pathep-[%s]", fabric_pod_id, fabric_path_end_point_container_nodeId, name) + cont, err := sm.Get(dn) + if err != nil { + return nil, err + } + + fabricPathEp := models.FabricPathEndpointFromContainer(cont) + return fabricPathEp, nil +} + +func (sm *ServiceManager) DeleteFabricPathEndpoint(name string, fabric_path_end_point_container_nodeId string, fabric_pod_id string) error { + dn := fmt.Sprintf("uni/topology/pod-%s/paths-%s/pathep-[%s]", fabric_pod_id, fabric_path_end_point_container_nodeId, name) + return sm.DeleteByDn(dn, models.FabricpathepClassName) +} + +func (sm *ServiceManager) UpdateFabricPathEndpoint(name string, fabric_path_end_point_container_nodeId string, fabric_pod_id string, description string, fabricPathEpattr models.FabricPathEndpointAttributes) (*models.FabricPathEndpoint, error) { + rn := fmt.Sprintf("pathep-[%s]", name) + parentDn := fmt.Sprintf("uni/topology/pod-%s/paths-%s", fabric_pod_id, fabric_path_end_point_container_nodeId) + fabricPathEp := models.NewFabricPathEndpoint(rn, parentDn, description, fabricPathEpattr) + + fabricPathEp.Status = "modified" + err := sm.Save(fabricPathEp) + return fabricPathEp, err + +} + +func (sm *ServiceManager) ListFabricPathEndpoint(fabric_path_end_point_container_nodeId string, fabric_pod_id string) ([]*models.FabricPathEndpoint, error) { + + baseurlStr := "/api/node/class" + dnUrl := fmt.Sprintf("%s/uni/topology/pod-%s/paths-%s/fabricPathEp.json", baseurlStr, fabric_pod_id, fabric_path_end_point_container_nodeId) + + cont, err := sm.GetViaURL(dnUrl) + list := models.FabricPathEndpointListFromContainer(cont) + + return list, err +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/client/firmwareCtrlrRunning_service.go b/vendor/github.com/ciscoecosystem/aci-go-client/client/firmwareCtrlrRunning_service.go new file mode 100644 index 000000000..42ee64b53 --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/client/firmwareCtrlrRunning_service.go @@ -0,0 +1,24 @@ +package client + +import ( + "fmt" + "github.com/ciscoecosystem/aci-go-client/models" +) + +func (sm *ServiceManager) ReadFirmwareCtrlrRunning(podId uint32, nodeId uint32) (*models.FirmwareCtrlrRunning, error) { + dn := fmt.Sprintf("topology/pod-%d/node-%d/sys/ctrlrfwstatuscont/ctrlrrunning", podId, nodeId) + cont, err := sm.Get(dn) + if err != nil { + return nil, err + } + firmwareFirmwareCtrlrRunning := models.FirmwareCtrlrRunningFromContainer(cont) + return firmwareFirmwareCtrlrRunning, nil +} + +func (sm *ServiceManager) ListFirmwareCtrlrRunning() ([]*models.FirmwareCtrlrRunning, error) { + baseurlStr := "/api/node/class" + dnUrl := fmt.Sprintf("%s/firmwareCtrlrRunning.json", baseurlStr) + cont, err := sm.GetViaURL(dnUrl) + list := models.FirmwareCtrlrRunningListFromContainer(cont) + return list, err +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/models/fabric_path_ep.go b/vendor/github.com/ciscoecosystem/aci-go-client/models/fabric_path_ep.go new file mode 100644 index 000000000..c6ca54f6e --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/models/fabric_path_ep.go @@ -0,0 +1,81 @@ +package models + +import ( + "fmt" + "strconv" + + "github.com/ciscoecosystem/aci-go-client/container" +) + +const FabricpathepClassName = "fabricPathEp" + +type FabricPathEndpoint struct { + BaseAttributes + FabricPathEndpointAttributes +} + +type FabricPathEndpointAttributes struct { + Name string `json:",omitempty"` +} + +func NewFabricPathEndpoint(fabricPathEpRn, parentDn, description string, fabricPathEpattr FabricPathEndpointAttributes) *FabricPathEndpoint { + dn := fmt.Sprintf("%s/%s", parentDn, fabricPathEpRn) + return &FabricPathEndpoint{ + BaseAttributes: BaseAttributes{ + DistinguishedName: dn, + Description: description, + Status: "created, modified", + ClassName: FabricpathepClassName, + Rn: fabricPathEpRn, + }, + + FabricPathEndpointAttributes: fabricPathEpattr, + } +} + +func (fabricPathEp *FabricPathEndpoint) ToMap() (map[string]string, error) { + fabricPathEpMap, err := fabricPathEp.BaseAttributes.ToMap() + if err != nil { + return nil, err + } + + A(fabricPathEpMap, "name", fabricPathEp.Name) + + return fabricPathEpMap, err +} + +func FabricPathEndpointFromContainerList(cont *container.Container, index int) *FabricPathEndpoint { + + FabricPathEndpointCont := cont.S("imdata").Index(index).S(FabricpathepClassName, "attributes") + return &FabricPathEndpoint{ + BaseAttributes{ + DistinguishedName: G(FabricPathEndpointCont, "dn"), + Description: G(FabricPathEndpointCont, "descr"), + Status: G(FabricPathEndpointCont, "status"), + ClassName: FabricpathepClassName, + Rn: G(FabricPathEndpointCont, "rn"), + }, + + FabricPathEndpointAttributes{ + Name: G(FabricPathEndpointCont, "name"), + }, + } +} + +func FabricPathEndpointFromContainer(cont *container.Container) *FabricPathEndpoint { + + return FabricPathEndpointFromContainerList(cont, 0) +} + +func FabricPathEndpointListFromContainer(cont *container.Container) []*FabricPathEndpoint { + length, _ := strconv.Atoi(G(cont, "totalCount")) + + arr := make([]*FabricPathEndpoint, length) + + for i := 0; i < length; i++ { + + arr[i] = FabricPathEndpointFromContainerList(cont, i) + } + + return arr +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/models/firmware_ctrlr_running.go b/vendor/github.com/ciscoecosystem/aci-go-client/models/firmware_ctrlr_running.go new file mode 100644 index 000000000..9ece2b712 --- /dev/null +++ b/vendor/github.com/ciscoecosystem/aci-go-client/models/firmware_ctrlr_running.go @@ -0,0 +1,91 @@ +package models + +import ( + "fmt" + "github.com/ciscoecosystem/aci-go-client/container" + "strconv" +) + +const FirmwareCtrlrRunningClassName = "firmwareCtrlrRunning" + +type FirmwareCtrlrRunning struct { + BaseAttributes + FirmwareCtrlrRunningAttributes +} + +type FirmwareCtrlrRunningAttributes struct { + Mode string `json:",omitempty"` + TpmInUse string `json:",omitempty"` + Ts string `json:",omitempty"` + Type string `json:",omitempty"` + Version string `json:",omitempty"` +} + +func NewFirmwareCtrlrRunning(firmwareCtrlrRunningRn, parentDn, description string, firmwareCtrlrRunningAttr FirmwareCtrlrRunningAttributes) *FirmwareCtrlrRunning { + dn := fmt.Sprintf("%s/%s", parentDn, firmwareCtrlrRunningRn) + return &FirmwareCtrlrRunning{ + BaseAttributes: BaseAttributes{ + DistinguishedName: dn, + Description: description, + Status: "", + ClassName: FirmwareCtrlrRunningClassName, + Rn: firmwareCtrlrRunningRn, + }, + FirmwareCtrlrRunningAttributes: firmwareCtrlrRunningAttr, + } +} + +func (firmwareCtrlrRunning *FirmwareCtrlrRunning) ToMap() (map[string]string, error) { + firmwareCtrlrRunningMap, err := firmwareCtrlrRunning.BaseAttributes.ToMap() + if err != nil { + return nil, err + } + + A(firmwareCtrlrRunningMap, "mode", firmwareCtrlrRunning.Mode) + A(firmwareCtrlrRunningMap, "tpmInUse", firmwareCtrlrRunning.TpmInUse) + A(firmwareCtrlrRunningMap, "ts", firmwareCtrlrRunning.Ts) + A(firmwareCtrlrRunningMap, "type", firmwareCtrlrRunning.Type) + A(firmwareCtrlrRunningMap, "version", firmwareCtrlrRunning.Version) + + return firmwareCtrlrRunningMap, err +} + +func FirmwareCtrlrRunningFromContainerList(cont *container.Container, index int) *FirmwareCtrlrRunning { + + FirmwareCtrlrRunningCont := cont.S("imdata").Index(index).S(FirmwareCtrlrRunningClassName, "attributes") + return &FirmwareCtrlrRunning{ + BaseAttributes{ + DistinguishedName: G(FirmwareCtrlrRunningCont, "dn"), + Description: G(FirmwareCtrlrRunningCont, "descr"), + Status: G(FirmwareCtrlrRunningCont, "status"), + ClassName: FirmwareCtrlrRunningClassName, + Rn: G(FirmwareCtrlrRunningCont, "rn"), + }, + + FirmwareCtrlrRunningAttributes{ + Mode: G(FirmwareCtrlrRunningCont, "mode"), + TpmInUse: G(FirmwareCtrlrRunningCont, "tpmInUse"), + Ts: G(FirmwareCtrlrRunningCont, "ts"), + Type: G(FirmwareCtrlrRunningCont, "type"), + Version: G(FirmwareCtrlrRunningCont, "version"), + }, + } +} + +func FirmwareCtrlrRunningFromContainer(cont *container.Container) *FirmwareCtrlrRunning { + + return FirmwareCtrlrRunningFromContainerList(cont, 0) +} + +func FirmwareCtrlrRunningListFromContainer(cont *container.Container) []*FirmwareCtrlrRunning { + length, _ := strconv.Atoi(G(cont, "totalCount")) + + arr := make([]*FirmwareCtrlrRunning, length) + + for i := 0; i < length; i++ { + + arr[i] = FirmwareCtrlrRunningFromContainerList(cont, i) + } + + return arr +} diff --git a/vendor/github.com/ciscoecosystem/aci-go-client/models/maint_maint_p.go b/vendor/github.com/ciscoecosystem/aci-go-client/models/maint_maint_p.go index fa6dc1b5e..14fe9a172 100644 --- a/vendor/github.com/ciscoecosystem/aci-go-client/models/maint_maint_p.go +++ b/vendor/github.com/ciscoecosystem/aci-go-client/models/maint_maint_p.go @@ -152,6 +152,8 @@ type MaintP struct { type MaintPAttributes struct { AdminSt string `json:",omitempty"` Annotation string `json:",omitempty"` + DnldSeqNum string `json:",omitempty"` + DownloadSt string `json:",omitempty"` Graceful string `json:",omitempty"` IgnoreCompat string `json:",omitempty"` InternalLabel string `json:",omitempty"` @@ -192,6 +194,8 @@ func (maintMaintP *MaintP) ToMap() (map[string]string, error) { A(maintMaintPMap, "adminSt", maintMaintP.AdminSt) A(maintMaintPMap, "annotation", maintMaintP.Annotation) + A(maintMaintPMap, "dnldSeqNum", maintMaintP.DnldSeqNum) + A(maintMaintPMap, "downloadSt", maintMaintP.DownloadSt) A(maintMaintPMap, "graceful", maintMaintP.Graceful) A(maintMaintPMap, "ignoreCompat", maintMaintP.IgnoreCompat) A(maintMaintPMap, "internalLabel", maintMaintP.InternalLabel) @@ -226,6 +230,8 @@ func MaintPFromContainerList(cont *container.Container, index int) *MaintP { MaintPAttributes{ AdminSt: G(MaintPCont, "adminSt"), Annotation: G(MaintPCont, "annotation"), + DnldSeqNum: G(MaintPCont, "dnldSeqNum"), + DownloadSt: G(MaintPCont, "downloadSt"), Graceful: G(MaintPCont, "graceful"), IgnoreCompat: G(MaintPCont, "ignoreCompat"), InternalLabel: G(MaintPCont, "internalLabel"), diff --git a/vendor/modules.txt b/vendor/modules.txt index 50e5093e8..8c8dc0fbe 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,7 +56,7 @@ github.com/aws/aws-sdk-go/service/sts/stsiface github.com/bgentry/go-netrc/netrc # github.com/bgentry/speakeasy v0.1.0 github.com/bgentry/speakeasy -# github.com/ciscoecosystem/aci-go-client v0.4.20 +# github.com/ciscoecosystem/aci-go-client v0.5.11 github.com/ciscoecosystem/aci-go-client/client github.com/ciscoecosystem/aci-go-client/container github.com/ciscoecosystem/aci-go-client/models diff --git a/website/docs/d/fabricpathep.html.markdown b/website/docs/d/fabricpathep.html.markdown new file mode 100644 index 000000000..9ac4e09ea --- /dev/null +++ b/website/docs/d/fabricpathep.html.markdown @@ -0,0 +1,33 @@ +--- +layout: "aci" +page_title: "ACI: aci_fabric_path_ep" +sidebar_current: "docs-aci-data-source-fabric_path_ep" +description: |- + Data source for ACI Fabric Path End point +--- + +# aci_fabric_path_ep # +Data source for ACI Fabric Path End point + +## Example Usage ## + +```hcl + +data "aci_fabric_path_ep" "example" { + pod_id = "1" + node_id = "101" + name = "eth1/7" +} + +``` + +## Argument Reference ## +* `pod_id` - (Required) pod ID for Object fabric path endpoint. +* `node_id` - (Required) node ID for Object fabric path endpoint. +* `name` - (Required) name of Object fabric path endpoint. + + + +## Attribute Reference + +* `id` - Attribute id set to the Dn of the Fabric Path End-point.