Comments (2)
As part of testing the PR referenced for this issue, I ran into another API problem. This example call works:
example :: IO (Either Error ())
example = do
lgr <- newLogger Trace stdout
env <- getEnv Oregon (FromEnv "AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY") <&> envLogger .~ lgr
let tableName = "AmazonikaTestTable"
throughput = provisionedThroughput 1 1
schema = keySchemaElement "ForumName" Hash :| [keySchemaElement "Subject" Range]
schema2 = keySchemaElement "ForumName" Hash :| [keySchemaElement "LastPostDateTime" Range]
schema3 = keySchemaElement "ForumName" Hash :| [keySchemaElement "FirstPostDateTime" Range]
attributeDefs = [ attributeDefinition "ForumName" S
, attributeDefinition "Subject" S
, attributeDefinition "LastPostDateTime" S
, attributeDefinition "FirstPostDateTime" S
]
proj = (projection $ "FirstPostDateTime" :| []) & pProjectionType .~ Just Include
proj2 = (projection $ "LastPostDateTime" :| []) & pProjectionType .~ Just Include
runAWST env $ do
r <- send $ createTable tableName schema throughput
& ctAttributeDefinitions .~ attributeDefs
& ctLocalSecondaryIndexes .~ [localSecondaryIndex "LastPostIndex" schema2 proj ]
& ctGlobalSecondaryIndexes .~ [globalSecondaryIndex "FirstPostIndex" schema3 proj2 throughput ]
return ()
... with this response:
[Client Response] {
status code = 200
status message = OK
version = HTTP/1.1
headers = x-amzn-requestid: JG7QGUK1K6KLCH49P83ATNOP67VV4KQNSO5AEMVJF66Q9ASUAAJG; x-amz-crc32: 4106595474; content-type: application/x-amz-json-1.0; content-length: 1292; date: Sun, 28 Dec 2014 02:23:51 GMT
cookies = CJ {expose = []}
}
[Client Response Body]
{"TableDescription":{"AttributeDefinitions":[{"AttributeName":"FirstPostDateTime","AttributeType":"S"},{"AttributeName":"ForumName","AttributeType":"S"},{"AttributeName":"LastPostDateTime","AttributeType":"S"},{"AttributeName":"Subject","AttributeType":"S"}],"CreationDateTime":1.41973343195E9,"GlobalSecondaryIndexes":[{"IndexName":"FirstPostIndex","IndexSizeBytes":0,"IndexStatus":"CREATING","ItemCount":0,"KeySchema":[{"AttributeName":"ForumName","KeyType":"HASH"},{"AttributeName":"FirstPostDateTime","KeyType":"RANGE"}],"Projection":{"NonKeyAttributes":["LastPostDateTime"],"ProjectionType":"INCLUDE"},"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":1,"WriteCapacityUnits":1}}],"ItemCount":0,"KeySchema":[{"AttributeName":"ForumName","KeyType":"HASH"},{"AttributeName":"Subject","KeyType":"RANGE"}],"LocalSecondaryIndexes":[{"IndexName":"LastPostIndex","IndexSizeBytes":0,"ItemCount":0,"KeySchema":[{"AttributeName":"ForumName","KeyType":"HASH"},{"AttributeName":"LastPostDateTime","KeyType":"RANGE"}],"Projection":{"NonKeyAttributes":["FirstPostDateTime"],"ProjectionType":"INCLUDE"}}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":1,"WriteCapacityUnits":1},"TableName":"AmazonikaTestTable","TableSizeBytes":0,"TableStatus":"CREATING"}}
Left (SerializerError "DynamoDB" "when expecting a ISO8601, encountered Number instead")
it :: Either Error ()
Two things:
0. AWS returns a unix epoch format for the creation time, not a ISO8601 time as expected by the response parser. A few other DynamoDB client calls fail with the same error, and I think a few other clients are probably affected as well.
- The example above needs to include valid definitions of some optional arguments for a successful response. By default,
LocalSecondaryIndexes
andGlobalSecondaryIndexes
lens values are included in the request body, but as[]
, instead of being omitted altogether. Not including those optional arguments in the request body results in an AWSValidationException
, since[]
is probably an invalid value for those keys:
[Client Response] {
status code = 400
status message = Bad Request
version = HTTP/1.1
headers = x-amzn-requestid: ALKENSE4DDH05T0T1L323G2T63VV4KQNSO5AEMVJF66Q9ASUAAJG; x-amz-crc32: 1761556321; content-type: application/x-amz-json-1.0; content-length: 153; date: Sun, 28 Dec 2014 02:41:11 GMT
cookies = CJ {expose = []}
}
Left (SerializerError "DynamoDB" "key \"code\" not present:\n{\"__type\":\"com.amazon.coral.validate#ValidationException\",\"message\":\"One or more parameter values were invalid: List of GlobalSecondaryIndexes is empty\"}")
from amazonka.
The fixes have been merged and released as 0.1.2.
from amazonka.
Related Issues (20)
- Release Checklist HOT 1
- amazonka-codecatalyst: parsing Gen.Types.Service.Signature failed HOT 3
- Type family to get IAM action name from a request type? HOT 6
- Serialize error: Failure parsing Time from value HOT 10
- Support STS Regional Endpoints
- IMDS IPv6 Endpoints
- Track botocore order of shape fields in generator HOT 1
- [amazonka-certificatemanager] 200 OK but serialization error HOT 2
- Kind of `Env`'s type variable HOT 2
- Proper formatting for `if-modified-since` timestamps in S3 HOT 2
- `amazonka-emr-containers` and `amazonka-emr-serverless` do not compile
- Deriving clauses of `Ptr` are not calculated correctly HOT 1
- Support enum types with numeric values HOT 4
- New region: Melbourne (ap-southeast-4)
- Item in GetItemResponse is not optional HOT 2
- Support `endpoint-rule-set-1.json`
- Looking for a way to specify a region other than the AWS ones HOT 2
- GHC 9.6 HOT 2
- Missing headers/preflight `OPTIONS` request in amazonka-2.0 HOT 9
- Haddocks for `main` provided by CI HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazonka.