Ejemplo n.º 1
0
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
"""
Simple application that logs on to the APIC and displays all
of the Endpoints.
"""
import sys
import getopt
import acitoolkit.acitoolkit as ACI
from acisampleslib import get_login_info

# Take login credentials from the command line if provided
# Otherwise, take them from credentials.py file
(LOGIN, PASSWORD, URL) = get_login_info(sys.argv)

# Login to APIC
session = ACI.Session(URL, LOGIN, PASSWORD)
resp = session.login()
if not resp.ok:
    print '%% Could not login to APIC'
    sys.exit(0)

# Download all of the interfaces
# and store the data as tuples in a list
data = []
endpoints = ACI.Endpoint.get(session)
for ep in endpoints:
    data.append((ep.mac, ep.ip))
Ejemplo n.º 2
0
#    License for the specific language governing permissions and limitations
#    under the License.
#
"""
Simple application that logs on to the APIC and displays all
of the Tenants.
"""
import sys
import acitoolkit.acitoolkit as ACI
from acisampleslib import get_login_info
from credentials import *

# Take login credentials from the command line if provided
# Otherwise, take them from your environment variables file ~/.profile
description = 'Simple application that logs on to the APIC and displays all of the Tenants.'
parser = get_login_info()
args = parser.parse_args()

# Login to APIC
session = ACI.Session(args.url, args.login, args.password)
resp = session.login()
if not resp.ok:
    print '%% Could not login to APIC'
    sys.exit(0)

# Download all of the tenants
print "TENANT"
print "------"
tenants = ACI.Tenant.get(session)
for tenant in tenants:
    print tenant.name
Simple application that logs on to the APIC and displays all
of the physical nodes; both belonging to and connected to the
fabric.
"""
import sys
from acitoolkit.acitoolkit import Session
from acitoolkit.aciphysobject import Node, ENode
from acisampleslib import get_login_info
from acitoolkit.acitoolkit import *
from credentials import *
import credentials

# Take login credentials from the command line if provided
# Otherwise, take them from your environment variables file ~/.profile
description = 'Simple application that logs on to the APIC and displays all of the physical nodes; both belonging to and connected to the fabric.'
parser = get_login_info(description)
args = parser.parse_args()

# Login to APIC
session = Session(args.url, args.login, args.password)
resp = session.login()
if not resp.ok:
    print '%% Could not login to APIC'
    sys.exit(0)

# List of classes to get and print
phy_classes = (Node, ENode)

for phy_class in phy_classes:
    # Print the class name
    class_name = phy_class.__name__
Ejemplo n.º 4
0
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
"""
Simple application that logs on to the APIC and displays all
of the Tenants.
"""
import sys
import getopt
import acitoolkit.acitoolkit as ACI
from acisampleslib import get_login_info

# Take login credentials from the command line if provided
# Otherwise, take them from credentials.py file
parser = get_login_info()
args = parser.parse_args()

# Login to APIC
session = ACI.Session(args.url, args.login, args.password)
resp = session.login()
if not resp.ok:
    print '%% Could not login to APIC'
    sys.exit(0)

# Download all of the tenants
print "TENANT"
print "------"
tenants = ACI.Tenant.get(session)
for tenant in tenants:
    print tenant.name