Skip to content

Commit 728cd27

Browse files
committed
updates
1 parent 9a949e5 commit 728cd27

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

Powershell/Powershell7/RealWorld/jsonsql.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ if ($s -eq 200) {
1111

1212
$queryPoke = @"
1313
INSERT INTO dbo.Pokemon (Id,Name,Height,Weight)
14-
VALUES ('$pokemon.Id','$pokemon.Name','$pokemon.Height','$pokemon.Weight')
14+
VALUES ($($pokemon.Id),$($pokemon.Name),$($pokemon.Height),$($pokemon.Weight),$(If($pokemon.is_default -eq $True){1}else{0}))
1515
"@
16+
$queryPoke
1617

1718
Invoke-Sqlcmd -ServerInstance "192.168.1.102" -Database "PokeDB" -Query $queryPoke
1819

Python/Networking/DNA/auth.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import requests
2+
import json
3+
4+
base_url = "https://dcloud-dna-center-inst-rtp.cisco.com/dna/"
5+
auth_endpoint = "system/api/v1/auth/token"
6+
7+
user = 'demo'
8+
password = 'demo1234!'
9+
10+
auth_response = requests.post(
11+
url=f"{base_url}{auth_endpoint}", auth=(user, password)).json()
12+
13+
token = auth_response['Token']
14+
15+
headers = {
16+
"x-auth-token": token,
17+
"Accept": "application/json",
18+
"Content-Type": "application/json"
19+
}
20+
21+
print(token)

0 commit comments

Comments
 (0)