AppSync: Powershell을 사용하여 AppSync 서버에 연결하는 REST API 스크립트를 생성하는 방법
Summary: 이 KB의 목적은 AppSync 서버에 연결하고 XML 출력을 파일로 반환하는 방법을 보여 주는 샘플 Powershell REST API 스크립트를 제공하는 것입니다.
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
다음 스크립트를 사용하여 AppSync 서버에 연결하고 서버에서 생성된 모든 서비스 계획과 관련된 세부 정보를 반환할 수 있습니다. 이는 간단한 예제이며 각 사용자의 특정 요구 사항에 맞게 수정해야 합니다.
add-type @"
using System.Net;
System.Security.Cryptography.X509Certificates 사용;
공개 클래스 TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult (
ServicePoint srvPoint, X509Certificate 인증서,
WebRequest 요청, int certificateProblem) {
return true;
}
}
"@
#Get 로그인 자격 증명 및 대상 서버
$user = Read-Host 'AppSync 관리자 사용자 ID 입력'
$pass = Read-Host 'AppSync 관리자 암호를 입력하세요.'
$ashost = Read-Host 'AppSync 서버의
이름 또는 IP 주소를 입력#create Login URL
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
[문자열] $loginuri = "https://" + $ashost + ":8444/cas-server/login"
$request = Invoke-WebRequest -Uri $loginuri -SessionVariable 세션
#Login CAS 서버
로$form = $request. 양식[0]
$form. Fields["사용자 이름"] = $user
$form. 필드["비밀번호"] = $pass
[문자열] $loginuri = "https://" + $ashost + ":8444/cas-server/login"+ $form. Action
$request = Invoke-WebRequest -Uri $loginuri -SessionVariable session -Body $form. 필드
#Execute Rest 요청
$url= "https://" + $ashost + ":8445/appsync/rest/types/servicePlan/instances"
$restrequest = Invoke-RestMethod -method GET -Uri $url -WebSession $session -outfile .\output1.xml
add-type @"
using System.Net;
System.Security.Cryptography.X509Certificates 사용;
공개 클래스 TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult (
ServicePoint srvPoint, X509Certificate 인증서,
WebRequest 요청, int certificateProblem) {
return true;
}
}
"@
#Get 로그인 자격 증명 및 대상 서버
$user = Read-Host 'AppSync 관리자 사용자 ID 입력'
$pass = Read-Host 'AppSync 관리자 암호를 입력하세요.'
$ashost = Read-Host 'AppSync 서버의
이름 또는 IP 주소를 입력#create Login URL
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
[문자열] $loginuri = "https://" + $ashost + ":8444/cas-server/login"
$request = Invoke-WebRequest -Uri $loginuri -SessionVariable 세션
#Login CAS 서버
로$form = $request. 양식[0]
$form. Fields["사용자 이름"] = $user
$form. 필드["비밀번호"] = $pass
[문자열] $loginuri = "https://" + $ashost + ":8444/cas-server/login"+ $form. Action
$request = Invoke-WebRequest -Uri $loginuri -SessionVariable session -Body $form. 필드
#Execute Rest 요청
$url= "https://" + $ashost + ":8445/appsync/rest/types/servicePlan/instances"
$restrequest = Invoke-RestMethod -method GET -Uri $url -WebSession $session -outfile .\output1.xml
Affected Products
AppSyncProducts
AppSyncArticle Properties
Article Number: 000158365
Article Type: How To
Last Modified: 18 Sept 2025
Version: 5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.