Skip to content

Commit c9391a7

Browse files
aws-ec2-legacy-exec (#509)
* aws-ec2-legacy-exec Summary: - Support for `aws.ec2,instances` legacy service lifecycle exec. - Added robot test `AWS EC2 Exec Instance Start Simple Exemplifies Legacy Form Encoded Request Body Exec`. - Added robot test `AWS EC2 Exec Instance Stop Simple Exemplifies Legacy Form Encoded Request Body Exec`. * - Ensure latest docker image used in `robot` testing.
1 parent 7b1d98a commit c9391a7

File tree

11 files changed

+126
-11
lines changed

11 files changed

+126
-11
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ jobs:
12831283
if: env.BUILD_IMAGE_REQUIRED == 'true'
12841284
run: |
12851285
docker pull --platform ${{ matrix.platform }} ${{ env.STACKQL_IMAGE_NAME }}@${{ steps.img_build.outputs.digest }}
1286+
docker tag ${{ env.STACKQL_IMAGE_NAME }}@${{ steps.img_build.outputs.digest }} ${{ env.STACKQL_IMAGE_NAME }}:latest
12861287
12871288
- name: Debug info
12881289
if: env.BUILD_IMAGE_REQUIRED == 'true'

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/spf13/cobra v1.4.0
2020
github.com/spf13/pflag v1.0.5
2121
github.com/spf13/viper v1.10.1
22-
github.com/stackql/any-sdk v0.0.5-alpha10
22+
github.com/stackql/any-sdk v0.0.5-alpha11
2323
github.com/stackql/go-suffix-map v0.0.1-alpha01
2424
github.com/stackql/psql-wire v0.1.1-alpha07
2525
github.com/stackql/stackql-parser v0.0.14-alpha04

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
482482
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
483483
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
484484
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
485-
github.com/stackql/any-sdk v0.0.5-alpha10 h1:XzByZRdbcYjkTuwV3mlg3PzxlULRBsOfpkA+t4kG4tA=
486-
github.com/stackql/any-sdk v0.0.5-alpha10/go.mod h1:4jYKpPoX2GWEK+qBnlGLvr8SUfndiYwHMIkg1dn9tFM=
485+
github.com/stackql/any-sdk v0.0.5-alpha11 h1:c4ief2XAI9AePpZpIqD4Lixh3nbeNeOQz0YSA44eplA=
486+
github.com/stackql/any-sdk v0.0.5-alpha11/go.mod h1:4jYKpPoX2GWEK+qBnlGLvr8SUfndiYwHMIkg1dn9tFM=
487487
github.com/stackql/go-suffix-map v0.0.1-alpha01 h1:TDUDS8bySu41Oo9p0eniUeCm43mnRM6zFEd6j6VUaz8=
488488
github.com/stackql/go-suffix-map v0.0.1-alpha01/go.mod h1:QAi+SKukOyf4dBtWy8UMy+hsXXV+yyEE4vmBkji2V7g=
489489
github.com/stackql/psql-wire v0.1.1-alpha07 h1:LQWVUlx4Bougk6dztDNG5tmXxpIVeeTSsInTj801xCs=

internal/stackql/parserutil/parser_util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,8 @@ func CheckSQLParserTypeVsResourceColumn(
720720
func CheckSQLParserTypeVsColumn(colUsage ColumnUsageMetadata, verifyCallback func(string, interface{}) bool) error {
721721
switch colUsage.ColVal.Type {
722722
case sqlparser.StrVal:
723-
if !verifyCallback(colUsage.ColName.Name.String(), "") {
723+
cn := colUsage.ColName.Name.String()
724+
if !verifyCallback(cn, "") {
724725
return fmt.Errorf("SHOW key = '%s' does NOT match SQL type '%s'", colUsage.ColName.Name.String(), "StrVal")
725726
}
726727
case sqlparser.IntVal:

internal/stackql/primitivegenerator/statement_analyzer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,10 @@ func (pb *standardPrimitiveGenerator) analyzeExec(pbi planbuilderinput.PlanBuild
656656
if !ok {
657657
return fmt.Errorf("could not cast node of type '%T' to required Exec", pbi.GetStatement())
658658
}
659-
tbl, err := pb.AnalyzeUnaryExec(pbi, handlerCtx, node, nil, nil) //nolint:ineffassign,staticcheck,lll,wastedassign // TODO: handle error
659+
tbl, err := pb.AnalyzeUnaryExec(pbi, handlerCtx, node, nil, nil)
660+
if err != nil {
661+
return err
662+
}
660663
insertionContainer, err := tableinsertioncontainer.NewTableInsertionContainer(
661664
tbl,
662665
handlerCtx.GetSQLEngine(),

test/python/flask/aws/root_path_cfg.json

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,63 @@
20182018
]
20192019
}
20202020
},
2021-
"template": "empty-response.json",
2021+
"template": "start_instances.xml",
2022+
"status": 200,
2023+
"response_headers": {
2024+
"Content-Type": ["text/xml"]
2025+
}
2026+
},
2027+
"POST:/:STARTSINGLEINSTANCE": {
2028+
"method": "POST",
2029+
"path": "/",
2030+
"headers": {
2031+
"Authorization": [
2032+
"^.*SignedHeaders=.*content-type;host;x-amz-date.*$"
2033+
]
2034+
},
2035+
"body_conditions": {
2036+
"type": "PARAMETERS",
2037+
"parameters": {
2038+
"Action": [
2039+
"^StartInstances$"
2040+
],
2041+
"Version": [
2042+
"^2016\\-11\\-15$"
2043+
],
2044+
"InstanceId": [
2045+
"id-001"
2046+
]
2047+
}
2048+
},
2049+
"template": "start_instances.xml",
2050+
"status": 200,
2051+
"response_headers": {
2052+
"Content-Type": ["text/xml"]
2053+
}
2054+
},
2055+
"POST:/:STOPSINGLEINSTANCE": {
2056+
"method": "POST",
2057+
"path": "/",
2058+
"headers": {
2059+
"Authorization": [
2060+
"^.*SignedHeaders=.*content-type;host;x-amz-date.*$"
2061+
]
2062+
},
2063+
"body_conditions": {
2064+
"type": "PARAMETERS",
2065+
"parameters": {
2066+
"Action": [
2067+
"^StopInstances$"
2068+
],
2069+
"Version": [
2070+
"^2016\\-11\\-15$"
2071+
],
2072+
"InstanceId": [
2073+
"id-001"
2074+
]
2075+
}
2076+
},
2077+
"template": "stop_instances.xml",
20222078
"status": 200,
20232079
"response_headers": {
20242080
"Content-Type": ["text/xml"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version=s"1.0" encoding="UTF-8"?> <StartInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>0000001-0001-0001-0001-0000000001</requestId> <instancesSet> <item> <instanceId>id-001</instanceId> <currentState> <code>0</code> <name>pending</name> </currentState> <previousState> <code>80</code> <name>stopped</name> </previousState> </item> </instancesSet> </StartInstancesResponse>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<StopInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
3+
<requestId>0000001-0001-0001-0001-0000000001</requestId>
4+
<instancesSet>
5+
<item>
6+
<instanceId>id-001</instanceId>
7+
<currentState>
8+
<code>64</code>
9+
<name>stopping</name>
10+
</currentState>
11+
<previousState>
12+
<code>64</code>
13+
<name>stopping</name>
14+
</previousState>
15+
</item>
16+
</instancesSet>
17+
</StopInstancesResponse>

test/python/flask/aws/templates/template_79.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/registry/src/aws/v0.1.0/services/ec2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42516,7 +42516,7 @@ components:
4251642516
response:
4251742517
mediaType: text/xml
4251842518
openAPIDocKey: '200'
42519-
id: aws.ec2.instances
42519+
id: aws.ec2.instances_start
4252042520
sqlVerbs:
4252142521
delete: []
4252242522
insert:

0 commit comments

Comments
 (0)