//native
type Neondb = {
apiKey: string
}
/**
* Get the list of VPC endpoints
* Retrieves the list of VPC endpoints for the specified organization.
This endpoint is under active development and its semantics may change in the future.
*/
export async function main(auth: Neondb, org_id: string, region_id: string) {
const url = new URL(
`https://console.neon.tech/api/v2/organizations/${org_id}/vpc/region/${region_id}/vpc-endpoints`
)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 428 days ago