This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YesIntent yes | |
YesIntent sure | |
AnswerIntent {first} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"intents": [ | |
{ | |
"intent": "YesIntent" | |
}, | |
{ | |
"slots": [ | |
{ | |
"name": "first", | |
"type": "AMAZON.NUMBER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
welcome: Welcome to the lab. I'm going to ask you which plug you want me to turn on. Ready? | |
select_action: Would you like to turn a socket on or off? | |
select_dev: Please tell me which power socket you would like to turn on? | |
power_on: I've turned the power socket on. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from pyservertech.auth import * | |
from pyservertech.core import * | |
from flask import Flask, render_template | |
from flask_ask import Ask, statement, question, session | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validate(vlan_bad, schema) | |
Traceback (most recent call last): | |
File "<input>", line 1, in <module> | |
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonschema/validators.py", line 541, in validate | |
cls(schema, *args, **kwargs).validate(instance) | |
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonschema/validators.py", line 130, in validate | |
raise error | |
jsonschema.exceptions.ValidationError: 5000 is greater than the maximum of 4094 | |
Failed validating 'maximum' in schema['properties']['vlan_id']: | |
{'description': 'The unique ID of the VLAN. IEEE 802.1Q VLAN ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jsonschema import validate | |
validate(vlan_good, schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema = json.loads('''{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"description": "VLAN configuration data.", | |
"title": "Vlan", | |
"type": "object", | |
"sql.max_rows": 4094, | |
"properties": { | |
"uri": { | |
"description": "The URI of the configuration entity", | |
"type": "string", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vlan_good = json.loads('''{ | |
"uri": "/vlans/1", | |
"vlan_id": 1, | |
"name": "DEFAULT_VLAN", | |
"status": "VS_PORT_BASED", | |
"type": "VT_STATIC", | |
"is_voice_enabled": false, | |
"is_jumbo_enabled": false, | |
"is_dsnoop_enabled": false, | |
"is_dhcp_server_enabled": false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Copyright 2015 Christopher Young ( @netmanchris ) | |
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the | |
License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required''' | |
from jinja2 import Environment, FileSystemLoader, Template | |
import yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPAddress | Name | ClientId | Description | InitialConfigFile | DHCPServer | ScopeId | |
---|---|---|---|---|---|---|---|
10.11.0.10 | 5400R | 64-51-06-79-0c-00 | Rserved for 5400R Mobile1st Branch | AdpInitialConfig5400R.cfg | 10.101.0.20 | 10.11.0.0 | |
10.11.0.11 | 2920stack | 74-46-a0-ff-78-e3 | Reserved for 2920 Stack | AdpInitialConfig2920.cfg | 10.101.0.20 | 10.11.0.0 |
NewerOlder