devnet Flashcards

1
Q

How do you define a tenant in Terraform using the ACI provider?

A

resource “aci_tenant” “tenant1” {
name = var.tenantName
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can contracts be dynamically created from a variable in Terraform?

A

Use for_each on var.contracts and access attributes like contract.name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you create EPGs using a loop in Terraform with ACI?

A

resource “aci_application_epg” “epgs” {
for_each = {
for epg_name, epg in var.epgs : epg_name => epg
}
application_profile_dn = aci_application_profile.appl.id
name = each.key
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you relate an EPG to a Contract in ACI Terraform?

A

Use a for_each loop on local.epgcontracts and set application_epg_dn, contract_dn, and contract_type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you model a list of networks in YANG?

A

list network {
key name;
leaf name { type string; }
leaf network-id { type uint16; mandatory true; }
leaf prefix { type string; mandatory true; }
leaf description { type string; mandatory true; }
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is needed to complete the access-ports YANG list model?

A

Add a leaf-list network with leafref pointing to ../../networks/name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you render VLAN configuration in an NSO XML template?

A

Use <vlan-list> under <vlan> with <id> and <name>, and optionally interface config for VLANs.</name></id></vlan></vlan-list>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What should be modified for access vs. trunk ports in the NSO config-template?

A

Change switchport config: access uses mode/access and trunk uses mode/trunk with encapsulation and allowed VLANs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you define a parser with choices for a ‘part’ parameter?

A

part_parser.add_argument(“part”, required=True, type=str, choices=tuple(Machine.inventory.keys()))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you add an optional field like backorder?

A

part_parser.add_argument(“backorder”, type=int, required=False)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you implement changing the MOTD in a POST method?

A

Use motd_parser to get the “msg” parameter and call Machine.set_motd(msg).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you define a part model in Flask-RESTX?

A

Use api.model(“Part”, {…}) with required fields like part_id, name, price, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you define a model for listing multiple parts?

A

Use api.model(“PartsList”, {“parts”: fields.List(fields.Nested(part_model))})

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is required to implement a capacity endpoint?

A

Use capacity_parser to parse “parameter” and return get_current_capacity() or get_max_capacity().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you handle errors with appropriate status codes for cash removal?

A

Return 200 if cash is removed, 400 if the operation fails.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the @api.deprecated decorator?

A

Marks a resource or method as deprecated in the OpenAPI documentation.

17
Q

What is required to initialize a GitLab CLI context using Click?

A

Check for GITLAB_USERNAME and GITLAB_PASSWORD, and set ctx.obj = GitLab().

18
Q

What does the –all/–pipelines-only flag control in your Click command?

A

Whether to list all projects or only those with pipelines.

19
Q

How do you list pipelines for a project using Click?

A

Add options –all/–latest and –project, and accept a GitLab object via @click.pass_obj.

20
Q

How do you retry a pipeline using Click CLI?

A

Use –project and –pipeline options, and ensure you pass the GitLab object.

21
Q

How do you configure an interface for OSPF in XML NETCONF?

A

<ospf>
<process-id><id>1</id><area></area><area-id>0</area-id></area></process-id>
<network><point-to-point></point-to-point></network>
</ospf>

22
Q

How do you define a router ID under OSPF in NETCONF XML?

A

<router-ospf>
<ospf>
<process-id>
<router-id>100.100.100.111</router-id>
</process-id>
</ospf>
</router-ospf>

23
Q

What’s the curl command to export configuration using RESTCONF in JSON?

A

curl -k ‘https://192.168.1.186/restconf/data/Cisco-IOS-XE-native:native’ –header ‘Accept: application/yang-data+json’ -u expert:1234QWer! > config.json