From 7cb4ef704cea8c2927eba82cfa5f500b734c360a Mon Sep 17 00:00:00 2001 From: preetrawal Date: Wed, 15 Mar 2023 10:19:24 -0400 Subject: [PATCH 1/4] fix: add trailing commas to starlark code --- docs/docs/reference/starlark-instructions.md | 4 ++-- docs/docs/reference/starlark-types.md | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/docs/reference/starlark-instructions.md b/docs/docs/reference/starlark-instructions.md index 3a6274dafd..0a0e80e816 100644 --- a/docs/docs/reference/starlark-instructions.md +++ b/docs/docs/reference/starlark-instructions.md @@ -469,13 +469,13 @@ Say we are overriding a connection between two subnetworks, as shown below: connection_config = ConnectionConfig( packet_delay_distribution = UniformPacketDelayDistribution( - ms = 500 + ms = 500, ) ) set_connection( subnetworks = ("subnetworkA", "subnetworkB"), - config = connection_config + config = connection_config, ) ``` diff --git a/docs/docs/reference/starlark-types.md b/docs/docs/reference/starlark-types.md index 40dd7399c6..578bc83097 100644 --- a/docs/docs/reference/starlark-types.md +++ b/docs/docs/reference/starlark-types.md @@ -23,7 +23,7 @@ connection_config = ConnectionConfig( # OPTIONAL: Valid value are UniformPacketDelayDistribution or NormalPacketDelayDistribution packet_delay_distribution = UniformPacketDelayDistribution( # Delay in ms - ms = 500 + ms = 500, ) ) ``` @@ -110,7 +110,7 @@ The user defined port IDs in above port map are: `http` and `grpc`. These can be recipe = GetHttpRequestRecipe( port_id = "http", service_name = "service-using-test-service-config", - endpoint = "/ping" + endpoint = "/ping", ... ) ``` @@ -178,7 +178,7 @@ delay = UniformPacketDelayDistribution( # Non-Negative Integer # Amount of constant delay added to outgoing packets from the subnetwork # MANDATORY - ms = 1000 + ms = 1000, ) ``` @@ -192,19 +192,19 @@ delay = NormalPacketDelayDistribution( # Non-Negative Integer # Amount of mean delay added to outgoing packets from the subnetwork # MANDATORY - mean_ms = 1000 + mean_ms = 1000, # Non-Negative Integer # Amount of variance (jitter) added to outgoing packets from the subnetwork # MANDATORY - std_dev_ms = 10 + std_dev_ms = 10, # Non-Negative Float # Percentage of correlation observed among packets. It means that the delay observed in next packet # will exhibit a corrlation factor of 10.0% with the previous packet. # OPTIONAL # DEFAULT = 0.0 - correlation = 10.0 + correlation = 10.0, ) ``` @@ -224,7 +224,7 @@ port_spec = PortSpec( # Application protocol for the port # Optional - application_protocol = "http" + application_protocol = "http", ) ``` The above constructor returns a `PortSpec` object that contains port information in the form of a [future reference][future-references-reference] and can be used with @@ -255,7 +255,7 @@ config = ServiceConfig( # Application protocol for the port # Optional - application_protocol = "http" + application_protocol = "http", ), }, @@ -324,7 +324,7 @@ update_service_config = UpdateServiceConfig( # The subnetwork to which the service will be moved. # "default" can be used to move the service to the default subnetwork # MANDATORY - subnetwork = "subnetwork_1" + subnetwork = "subnetwork_1", ) ``` From 9a67b0b2522c596379cd4f266c3e95546ac77571 Mon Sep 17 00:00:00 2001 From: preetrawal Date: Wed, 15 Mar 2023 10:40:28 -0400 Subject: [PATCH 2/4] added more commas --- docs/docs/reference/starlark-instructions.md | 2 +- docs/docs/reference/starlark-types.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/reference/starlark-instructions.md b/docs/docs/reference/starlark-instructions.md index 0a0e80e816..50319eb52f 100644 --- a/docs/docs/reference/starlark-instructions.md +++ b/docs/docs/reference/starlark-instructions.md @@ -470,7 +470,7 @@ Say we are overriding a connection between two subnetworks, as shown below: connection_config = ConnectionConfig( packet_delay_distribution = UniformPacketDelayDistribution( ms = 500, - ) + ), ) set_connection( diff --git a/docs/docs/reference/starlark-types.md b/docs/docs/reference/starlark-types.md index 578bc83097..15f01a7f79 100644 --- a/docs/docs/reference/starlark-types.md +++ b/docs/docs/reference/starlark-types.md @@ -24,7 +24,7 @@ connection_config = ConnectionConfig( packet_delay_distribution = UniformPacketDelayDistribution( # Delay in ms ms = 500, - ) + ), ) ``` @@ -85,7 +85,7 @@ get_request_recipe = GetHttpRequestRecipe( # OPTIONAL extract = { "extractfield" : ".name.id" - } + }, ) ``` @@ -97,9 +97,9 @@ Important - `port_id` field accepts user defined ID assinged to a port in servic ports = { // "port_id": port_number "http": 5000, - "grpc": 3000 + "grpc": 3000, ... - } + }, ... ) ``` @@ -154,7 +154,7 @@ post_request_recipe = PostHttpRequestRecipe( # OPTIONAL extract = { "extractfield" : ".name.id" - } + }, ) ``` From 0a33f37e0aea49ac7332f9512e0ffeaa5f61e6b0 Mon Sep 17 00:00:00 2001 From: preetrawal Date: Wed, 15 Mar 2023 10:51:43 -0400 Subject: [PATCH 3/4] added more --- docs/docs/reference/starlark-instructions.md | 4 ++-- docs/docs/reference/starlark-types.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/reference/starlark-instructions.md b/docs/docs/reference/starlark-instructions.md index 50319eb52f..1811f649da 100644 --- a/docs/docs/reference/starlark-instructions.md +++ b/docs/docs/reference/starlark-instructions.md @@ -115,7 +115,7 @@ all_services = plan.add_services( configs = { "example-datastore-server-1": datastore_server_config_1, "example-datastore-server-2": datastore_server_config_2, - } + }, ) ``` @@ -398,7 +398,7 @@ The instruction returns a response, which is a `dict` with following key-value p post_request_recipe = PostHttpRequestRecipe( ... extract = { - "second-element-from-list-head": '.result.foo | .[0] | split ("/") | .[1]' # + "second-element-from-list-head": '.result.foo | .[0] | split ("/") | .[1]', }, ) response = plan.request( diff --git a/docs/docs/reference/starlark-types.md b/docs/docs/reference/starlark-types.md index 15f01a7f79..12a147d1d8 100644 --- a/docs/docs/reference/starlark-types.md +++ b/docs/docs/reference/starlark-types.md @@ -84,7 +84,7 @@ get_request_recipe = GetHttpRequestRecipe( # To lean more about jq, please visit https://devdocs.io/jq/ # OPTIONAL extract = { - "extractfield" : ".name.id" + "extractfield" : ".name.id", }, ) ``` From c7f88f6504fcee49ea0f323ea0362173b0dbbe80 Mon Sep 17 00:00:00 2001 From: Derek Lee Date: Thu, 16 Mar 2023 15:07:33 -0300 Subject: [PATCH 4/4] docs: missed one comma --- docs/docs/reference/starlark-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/reference/starlark-types.md b/docs/docs/reference/starlark-types.md index 12a147d1d8..1dedfd8276 100644 --- a/docs/docs/reference/starlark-types.md +++ b/docs/docs/reference/starlark-types.md @@ -153,7 +153,7 @@ post_request_recipe = PostHttpRequestRecipe( # # To lean more about jq, please visit https://devdocs.io/jq/ # OPTIONAL extract = { - "extractfield" : ".name.id" + "extractfield" : ".name.id", }, ) ```