Aug 15 2023
Jun 28 2023
Resource
BlogTopic
Edge ComputeDate
Aug 19, 2019StackPath has won the 2019 API Award for Best in DevOps APIs. This award recognizes StackPath’s Edge Compute API that allows developers to control and receive information about workloads for Edge Containers and Edge VMs. Each product is part of StackPath’s global edge platform that puts enterprise-scale compute power closer to devices running latency-sensitive applications.
The 2019 API Awards received hundreds of nominations and the judges for the API Awards selected Edge Compute based on three criteria:
“StackPath is a shining example of the API technologies now empowering developers and engineers to build upon the backbone of the multi-trillion-dollar market for API-driven products and services,” said Jonathan Pasky, the producer of API World.
Using StackPath’s REST API developers can update workloads, retrieve usage metrics for an individual workload or multiple workloads, retrieve a stream of logs for a container, create and view network policies, and much more.
Here’s an example of an endpoint you can send a GET request to for an edge container’s logs:
https://gateway.stackpath.com/workload/v1/stacks/ff86d46c-d49a-4310-947f-46d1e5dfb8f8/workloads/843313fd-9d45-42cd-ab02-066738ea828a/instances/debug-server-na-atl-0/logs
You can use cURL to initiate your request:
curl --request GET --url 'https://gateway.stackpath.com/workload/v1/stacks/ff86d46c-d49a-4310-947f-46d1e5dfb8f8/workloads/843313fd-9d45-42cd-ab02-066738ea828a/instances/debug-server-na-atl-0/logs?since_seconds=300&tail_lines=5'
Here we have appended two query parameters. The first parameter (since_seconds) is saying that we want logs since 300 seconds before the request. The second parameter (tail_lines) is saying that we want to view the last 5 lines from the end of the logs for that time frame.
In this example the container we’re requesting logs for is a DNS proxy server, so we receive the following response after making the request (IPs obfuscated):
2019-08-13 11:47:02 [DNSHandler:Resolver] Reply: [01.001.001.1:48497] (udp) / 'superclevergenericdomainnAME.Com.' (A) / RRs:
2019-08-13 11:47:02 [DNSHandler:Resolver] Request: [01.001.001.1:36738] (udp) / 'superclevergenericdomainnAME.Com.' (A)
2019-08-13 11:47:02 [DNSHandler:Resolver] Reply: [01.001.001.1:64271] (udp) / 'superclevergenericdomainnAME.Com.' (A) / RRs:
2019-08-13 11:47:02 [DNSHandler:Resolver] Reply: [01.001.001.1:36738] (udp) / 'superclevergenericdomainnAME.Com.' (A) / RRs:
2019-08-13 11:47:02 [DNSHandler:Resolver] Reply: [01.001.001.1:61814] (udp) / 'superclevergenericdomainnAME.Com.' (A) / RRs:
StackPath’s API Reference makes it easy to use the API to retrieve information like this using cURL, Node, Ruby, JavaScript, and Python. Simply enter your parameters into the input fields and your request is automatically generated.
Want to try it out? Right now you can with $100 in free edge compute credits. Create a StackPath account here to apply these credits to Edge Containers or VMs.