Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const functions = new Functions(client);

const result = await functions.listSpecifications();
const result = await functions.listSpecifications({
type: 'runtimes' // optional
});

console.log(result);
```
3 changes: 2 additions & 1 deletion examples/1.9.x/console-web/examples/oauth2/authorize.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const result = await oauth2.authorize({
codeChallengeMethod: 's256', // optional
prompt: '<PROMPT>', // optional
maxAge: 0, // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>' // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>', // optional
resource: '' // optional
});

console.log(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const oauth2 = new Oauth2(client);
const result = await oauth2.createDeviceAuthorization({
clientId: '<CLIENT_ID>', // optional
scope: '<SCOPE>', // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>' // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>', // optional
resource: '' // optional
});

console.log(result);
Expand Down
3 changes: 2 additions & 1 deletion examples/1.9.x/console-web/examples/oauth2/create-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const result = await oauth2.createToken({
clientId: '<CLIENT_ID>', // optional
clientSecret: '<CLIENT_SECRET>', // optional
codeVerifier: '<CODE_VERIFIER>', // optional
redirectUri: 'https://example.com' // optional
redirectUri: 'https://example.com', // optional
resource: '' // optional
});

console.log(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const sites = new Sites(client);

const result = await sites.listSpecifications();
const result = await sites.listSpecifications({
type: 'runtimes' // optional
});

console.log(result);
```
2 changes: 1 addition & 1 deletion examples/1.9.x/console-web/examples/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new Client()
const usage = new Usage(client);

const result = await usage.listEvents({
metric: '<METRIC>',
metrics: [],
resource: '<RESOURCE>', // optional
resourceId: '<RESOURCE_ID>', // optional
interval: '1m', // optional
Expand Down
2 changes: 1 addition & 1 deletion examples/1.9.x/console-web/examples/usage/list-gauges.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new Client()
const usage = new Usage(client);

const result = await usage.listGauges({
metric: '<METRIC>',
metrics: [],
resourceId: '<RESOURCE_ID>', // optional
teamId: '<TEAM_ID>', // optional
interval: '1m', // optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ Client client = Client()

Functions functions = Functions(client);

SpecificationList result = await functions.listSpecifications();
SpecificationList result = await functions.listSpecifications(
type: 'runtimes', // (optional)
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ Client client = Client()

Sites sites = Sites(client);

SpecificationList result = await sites.listSpecifications();
SpecificationList result = await sites.listSpecifications(
type: 'runtimes', // (optional)
);
```
2 changes: 1 addition & 1 deletion examples/1.9.x/server-dart/examples/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Client client = Client()
Usage usage = Usage(client);

UsageEventList result = await usage.listEvents(
metric: '<METRIC>',
metrics: [],
resource: '<RESOURCE>', // (optional)
resourceId: '<RESOURCE_ID>', // (optional)
interval: '1m', // (optional)
Expand Down
2 changes: 1 addition & 1 deletion examples/1.9.x/server-dart/examples/usage/list-gauges.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Client client = Client()
Usage usage = Usage(client);

UsageGaugeList result = await usage.listGauges(
metric: '<METRIC>',
metrics: [],
resourceId: '<RESOURCE_ID>', // (optional)
teamId: '<TEAM_ID>', // (optional)
interval: '1m', // (optional)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Client client = new Client()

Functions functions = new Functions(client);

SpecificationList result = await functions.ListSpecifications();
```
SpecificationList result = await functions.ListSpecifications(
type: "runtimes" // optional
);```
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Client client = new Client()

Sites sites = new Sites(client);

SpecificationList result = await sites.ListSpecifications();
```
SpecificationList result = await sites.ListSpecifications(
type: "runtimes" // optional
);```
2 changes: 1 addition & 1 deletion examples/1.9.x/server-dotnet/examples/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Client client = new Client()
Usage usage = new Usage(client);

UsageEventList result = await usage.ListEvents(
metric: "<METRIC>",
metrics: new List<string>(),
resource: "<RESOURCE>", // optional
resourceId: "<RESOURCE_ID>", // optional
interval: "1m", // optional
Expand Down
2 changes: 1 addition & 1 deletion examples/1.9.x/server-dotnet/examples/usage/list-gauges.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Client client = new Client()
Usage usage = new Usage(client);

UsageGaugeList result = await usage.ListGauges(
metric: "<METRIC>",
metrics: new List<string>(),
resourceId: "<RESOURCE_ID>", // optional
teamId: "<TEAM_ID>", // optional
interval: "1m", // optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ client := client.New(

service := functions.New(client)

response, error := service.ListSpecifications())
response, error := service.ListSpecifications(
functions.WithListSpecificationsType("runtimes"),
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ client := client.New(

service := sites.New(client)

response, error := service.ListSpecifications())
response, error := service.ListSpecifications(
sites.WithListSpecificationsType("runtimes"),
)
```
2 changes: 1 addition & 1 deletion examples/1.9.x/server-go/examples/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ client := client.New(
service := usage.New(client)

response, error := service.ListEvents(
"<METRIC>",
[]string{},
usage.WithListEventsResource("<RESOURCE>"),
usage.WithListEventsResourceId("<RESOURCE_ID>"),
usage.WithListEventsInterval("1m"),
Expand Down
2 changes: 1 addition & 1 deletion examples/1.9.x/server-go/examples/usage/list-gauges.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ client := client.New(
service := usage.New(client)

response, error := service.ListGauges(
"<METRIC>",
[]string{},
usage.WithListGaugesResourceId("<RESOURCE_ID>"),
usage.WithListGaugesTeamId("<TEAM_ID>"),
usage.WithListGaugesInterval("1m"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
```graphql
query {
functionsListSpecifications {
functionsListSpecifications(
type: "runtimes"
) {
total
specifications {
memory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
```graphql
query {
sitesListSpecifications {
sitesListSpecifications(
type: "runtimes"
) {
total
specifications {
memory
Expand Down
39 changes: 21 additions & 18 deletions examples/1.9.x/server-graphql/examples/usage/list-events.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
```graphql
query {
usageListEvents(
metric: "<METRIC>",
metrics: [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Pass a metric

The usage endpoint requires one to ten metric names, but the GraphQL example passes metrics: []. A copied query asks for no series, so it can fail validation or return an empty result instead of demonstrating the new response shape.

Suggested change
metrics: [],
metrics: ["executions"],

resource: "<RESOURCE>",
resourceId: "<RESOURCE_ID>",
interval: "1m",
Expand All @@ -13,24 +13,27 @@ query {
limit: 1,
offset: 0
) {
metric
interval
groups {
time
value
path
method
status
service
country
region
hostname
osName
clientType
clientName
deviceName
teamId
resourceId
metrics {
metric
points {
time
value
path
method
status
service
country
region
hostname
osName
clientType
clientName
deviceName
teamId
resourceId
resource
}
}
}
}
Expand Down
39 changes: 21 additions & 18 deletions examples/1.9.x/server-graphql/examples/usage/list-gauges.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
```graphql
query {
usageListGauges(
metric: "<METRIC>",
metrics: [],
resourceId: "<RESOURCE_ID>",
teamId: "<TEAM_ID>",
interval: "1m",
Expand All @@ -13,24 +13,27 @@ query {
limit: 1,
offset: 0
) {
metric
interval
groups {
time
value
path
method
status
service
country
region
hostname
osName
clientType
clientName
deviceName
teamId
resourceId
metrics {
metric
points {
time
value
path
method
status
service
country
region
hostname
osName
clientType
clientName
deviceName
teamId
resourceId
resource
}
}
}
}
Expand Down
18 changes: 11 additions & 7 deletions examples/1.9.x/server-kotlin/java/functions/list-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ Client client = new Client()

Functions functions = new Functions(client);

functions.listSpecifications(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
functions.listSpecifications(
"runtimes", // type (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

System.out.println(result);
}));
```
18 changes: 11 additions & 7 deletions examples/1.9.x/server-kotlin/java/sites/list-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ Client client = new Client()

Sites sites = new Sites(client);

sites.listSpecifications(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
sites.listSpecifications(
"runtimes", // type (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

System.out.println(result);
}));
```
2 changes: 1 addition & 1 deletion examples/1.9.x/server-kotlin/java/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Client client = new Client()
Usage usage = new Usage(client);

usage.listEvents(
"<METRIC>", // metric
List.of(), // metrics
"<RESOURCE>", // resource (optional)
"<RESOURCE_ID>", // resourceId (optional)
"1m", // interval (optional)
Expand Down
2 changes: 1 addition & 1 deletion examples/1.9.x/server-kotlin/java/usage/list-gauges.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Client client = new Client()
Usage usage = new Usage(client);

usage.listGauges(
"<METRIC>", // metric
List.of(), // metrics
"<RESOURCE_ID>", // resourceId (optional)
"<TEAM_ID>", // teamId (optional)
"1m", // interval (optional)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ val client = Client()

val functions = Functions(client)

val response = functions.listSpecifications()
val response = functions.listSpecifications(
type = "runtimes" // optional
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ val client = Client()

val sites = Sites(client)

val response = sites.listSpecifications()
val response = sites.listSpecifications(
type = "runtimes" // optional
)
```
2 changes: 1 addition & 1 deletion examples/1.9.x/server-kotlin/kotlin/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ val client = Client()
val usage = Usage(client)

val response = usage.listEvents(
metric = "<METRIC>",
metrics = listOf(),
resource = "<RESOURCE>", // optional
resourceId = "<RESOURCE_ID>", // optional
interval = "1m", // optional
Expand Down
Loading