### Example of Replication Guide Syntax Source: https://github.com/dynamods/dynamo/wiki/Replication-and-Replication-Guide-Part-3 Demonstrates the syntax for applying replication guides to function arguments. Each guide specifies a replication level and lacing strategy (e.g., <1L> for Longest Lacing). ```python foo(xs<1L><2>, ys<1L><3>, zs<1L><2><2>) ``` -------------------------------- ### DynamoDB Local Setup Example Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/cs-CZ/NodeAutocompleteDocumentation.html Instructions for setting up and running DynamoDB Local for development and testing purposes. ```bash # Download DynamoDB Local from the AWS website. # Unzip the downloaded file. # Start DynamoDB Local (example command): java -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar -sharedDb -dbPath ./database # Configure your AWS SDK to point to the local endpoint: # AWS.config.update({ endpoint: 'http://localhost:8000' }); ``` -------------------------------- ### DynamoDB Global Tables Setup Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/fr-FR/NodeAutocompleteDocumentation.html Conceptual example of setting up DynamoDB Global Tables. This involves creating identical tables in multiple regions and enabling streams. ```python # This is a conceptual example and requires actual AWS SDK calls for each region. # Example for us-east-1: db_east = boto3.resource('dynamodb', region_name='us-east-1') table_east = db_east.create_table( TableName='global_users', # ... (same schema as other regions) StreamSpecification={'StreamEnabled': True, 'StreamViewType': 'NEW_AND_OLD_IMAGES'} ) # Example for eu-west-1: db_west = boto3.resource('dynamodb', region_name='eu-west-1') table_west = db_west.create_table( TableName='global_users', # ... (same schema as other regions) StreamSpecification={'StreamEnabled': True, 'StreamViewType': 'NEW_AND_OLD_IMAGES'} ) print('Global tables setup initiated.') ``` -------------------------------- ### DynamoDB Global Tables Setup Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/es-ES/Controls/NodeAutocompleteDocumentation.html Illustrates the concept of setting up DynamoDB Global Tables for multi-region replication. This is a conceptual example and requires AWS CLI or SDK for actual implementation. ```bash # Conceptual example using AWS CLI # Create table in us-east-1 aws dynamodb create-table --table-name MyGlobalTable --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --region us-east-1 # Enable DynamoDB Streams aws dynamodb update-table --table-name MyGlobalTable --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES --region us-east-1 # Create replica table in eu-west-1 aws dynamodb create-table --table-name MyGlobalTable --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --region eu-west-1 # Enable DynamoDB Streams for replica aws dynamodb update-table --table-name MyGlobalTable --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES --region eu-west-1 # Create global table aws dynamodb create-global-table --global-table-name MyGlobalTable --replication-group RegionName=us-east-1 RegionName=eu-west-1 --region us-east-1 ``` -------------------------------- ### DynamoDB Global Tables Setup Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/es-ES/NodeAutocompleteDocumentation.html Conceptual example of setting up DynamoDB Global Tables. This involves creating identical tables in multiple regions and enabling global replication. ```python # This is a conceptual example. Actual implementation requires # creating tables in each region and then enabling global tables. import boto3 # Assume 'us-east-1' table is already created client_us_east_1 = boto3.client('dynamodb', region_name='us-east-1') # Assume 'eu-west-1' table is already created client_eu_west_1 = boto3.client('dynamodb', region_name='eu-west-1') # To enable global tables, you would use the AWS CLI or SDK operations # to associate the tables as replicas of each other. # Example (conceptual, not direct SDK call for enabling global tables): # aws dynamodb update-table --table-name users --replica-updates '[{"Create": {"RegionName": "eu-west-1"}}]' print("Conceptual setup for DynamoDB Global Tables.") print("Ensure tables exist in target regions before enabling replication.") ``` -------------------------------- ### Install Mono on OS X Source: https://github.com/dynamods/dynamo/wiki/Dynamo-on-Linux,-Mac Install Mono and the GDI+ library on OS X using Homebrew. Ensure Homebrew is installed first from brew.sh. ```bash # brew install mono mono-libgdiplus ``` -------------------------------- ### Example: Build NuGet Packages with Release Binaries Source: https://github.com/dynamods/dynamo/blob/master/tools/NuGet/README.md Alternative example for building NuGet packages using binaries from a Release configuration build. ```bash .\BuildPackages.bat "template-artifactory" "...\GitHub\Dynamo\bin\AnyCPU\Release" ``` -------------------------------- ### DynamoDB Item Insertion Example Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/es-ES/Controls/NodeAutocompleteDocumentation.html This example shows how to insert a new item into a DynamoDB table. It requires a pre-existing table and the AWS SDK setup. ```javascript const AWS = require("aws-sdk"); AWS.config.update({ region: "us-east-1" }); const dynamodb = new AWS.DynamoDB(); const params = { Item: { CUSTOMER_ID: { S: "ABCDEFG" }, NAME: { S: "John Doe" }, EMAIL: { S: "john.doe@example.com" }, HISTORY: { L: [ { S: "Item1" }, { S: "Item2" } ] } }, ReturnConsumedCapacity: "TOTAL", TableName: "ExampleTableForErrors" }; dynamodb.putItem(params, function(err, data) { if (err) { console.error("Unable to add item. Error JSON:", JSON.stringify(err, null, 2)); } else { console.log("PutItem succeeded:", JSON.stringify(data, null, 2)); } }); ``` -------------------------------- ### DynamoDB Batch Get Items with No Return Values Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of performing a batch get operation without specifying return values. The default behavior is to return the items themselves. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_no_return_values(request_items): dynamodb = boto3.resource('dynamodb') response = dynamodb.batch_get_item( RequestItems=request_items # No specific ReturnValues parameter for BatchGetItem; items are returned by default. ) return response ``` -------------------------------- ### Navigate and Build WPF Source: https://github.com/dynamods/dynamo/wiki/building-WPF-from-source-for-advanced-instrumentation-and-debugging-in-Dynamo Change directory to the cloned repository and execute the build script for the x64 platform. ```bash cd build.cmd -platform x64 ``` -------------------------------- ### DynamoDB Batch Get Items with Consistent Read Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of performing a batch get operation with strongly consistent reads. This ensures that all retrieved items are the latest versions. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_consistent_read(request_items): dynamodb = boto3.resource('dynamodb') response = dynamodb.batch_get_item( RequestItems=request_items, ConsistentRead=True ) return response ``` -------------------------------- ### Example: Build NuGet Packages Source: https://github.com/dynamods/dynamo/blob/master/tools/NuGet/README.md Example of building NuGet packages, specifying the nuspec template folder and the Dynamo build output directory. ```bash .\BuildPackages.bat "template-artifactory" "...\GitHub\Dynamo\src\DynamoInstall\harvest" ``` -------------------------------- ### DynamoDB Batch Get Items with Default Return Values Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of performing a batch get operation without specifying return values. The default behavior is to return the items themselves. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_default_return_values(request_items): dynamodb = boto3.resource('dynamodb') response = dynamodb.batch_get_item( RequestItems=request_items # No specific ReturnValues parameter for BatchGetItem; items are returned by default. ) return response ``` -------------------------------- ### DynamoDB Backup and Restore Example Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/cs-CZ/NodeAutocompleteDocumentation.html Shows how to initiate a backup of a DynamoDB table and restore it to a new table. ```javascript const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB(); // Initiate backup const backupParams = { TableName: 'YourTableName', BackupName: 'MyTableBackup-' + Date.now() }; dynamoDb.createBackup(backupParams, (error, data) => { if (error) { console.error('Unable to create backup. Error JSON:', JSON.stringify(error, null, 2)); } else { console.log('Backup initiated. Backup details:', data.BackupDetails); const backupArn = data.BackupDetails.BackupArn; // Restore from backup (example) const restoreParams = { TargetTableName: 'RestoredTableName', BackupName: backupParams.BackupName // Use the ARN if restoring from a different account/region }; dynamoDb.restoreTableFromBackup(restoreParams, (restoreError, restoreData) => { if (restoreError) { console.error('Unable to restore table. Error JSON:', JSON.stringify(restoreError, null, 2)); } else { console.log('Restore initiated. Table description:', restoreData.TableDescription); } }); } }); ``` -------------------------------- ### Update AppVersion in Inno Setup Script Source: https://github.com/dynamods/dynamo/blob/master/tools/install/CreatingInstallers.txt Modify the AppVersion and VersionInfoVersion fields within the [Setup] section of the .iss file to reflect the new version number before building the installer. ```ini [Setup] ... AppVersion=0.3.0 VersionInfoVersion=0.3.0 ``` -------------------------------- ### Generate Docs for DSRevitNodesUI.dll with Revit References Source: https://github.com/dynamods/dynamo/blob/master/src/Tools/NodeDocumentationMarkdownGenerator/readme.md Generates documentation for DSRevitNodesUI.dll, importing dictionary content, and compressing images. This example also includes references to Revit API DLLs and specifies output directory and dictionary JSON. ```bash fromdirectory -i "C:\Users\...\Documents\GitHub\DynamoRevit\bin\AnyCPU\Release\Revit\nodes" -f DSRevitNodesUI.dll -o "C:\Users\...\Desktop\TestMdOutputRevitNodes - Compressed" -d "C:\Users\...\Documents\GitHub\DynamoDictionary\public\data\Dynamo_Nodes_Revit.json" -x "C:\Users\...\Documents\GitHub\DynamoRevit\src\DynamoRevit\Resources\LayoutSpecs.json" -r "C:\Users\...\Desktop\PathToFolderWithRevitAPI" "C:\...\DynamoRevit\bin\AnyCPU\Debug\Revit" -w -s ``` -------------------------------- ### Batch Get Items (Python) Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/pt-BR/NodeAutocompleteDocumentation.html Python example for retrieving multiple items from DynamoDB. ```python import boto3 db = boto3.resource('dynamodb', region_name='us-west-2', endpoint_url="http://localhost:8000") table = db.Table('Movies') response = table.batch_get_item( RequestItems={ 'Movies': { 'Keys': [ {'year': 2015, 'title': 'The Big New Movie'}, {'year': 2013, 'title': 'The Great Adventure'} ], 'ProjectionExpression': '#yr, title, info.genres', 'ExpressionAttributeNames': { '#yr': 'year' } } } ) print(response['Responses']['Movies']) ``` -------------------------------- ### Get Item (Python) Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/pt-BR/NodeAutocompleteDocumentation.html Python example for retrieving a single item from a DynamoDB table. ```python import boto3 db = boto3.resource('dynamodb', region_name='us-west-2', endpoint_url="http://localhost:8000") table = db.Table('Movies') response = table.get_item( Key={ 'year': 2015, 'title': 'The Big New Movie' } ) item = response['Item'] print(item) ``` -------------------------------- ### DynamoDB Client - Get Global Table Information Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ja-JP/NodeAutocompleteDocumentation.html Retrieves information about global tables. This example uses the DescribeTableCommand to get table details, which includes global secondary indexes if configured. ```javascript import { DynamoDBClient, DescribeTableCommand } from "@aws-sdk/client-dynamodb"; const client = new DynamoDBClient({}); const main = async () => { const command = new DescribeTableCommand({ TableName: "products", }); const response = await client.send(command); console.log(response.Table.GlobalSecondaryIndexes); }; main(); ``` -------------------------------- ### Initialize Library Controller and View Source: https://github.com/dynamods/dynamo/blob/master/src/LibraryViewExtensionWebView2/Packages/LibrarieJS/library.html Creates a library controller and its associated view, then sets the initial host context and refreshes the library view. This is a setup function for the library interface. ```javascript //Create library controller var libController = LibraryEntryPoint.CreateLibraryController(); //Create library view var libContainer = libController.createLibraryByElementId("libraryContainerPlaceholder"); refreshLibraryView(libController); //initial state libController.setHostContext("home") ``` -------------------------------- ### Get Stream Records Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ko-KR/NodeAutocompleteDocumentation.html Example of retrieving records from a DynamoDB Stream using the AWS SDK. ```python import boto3 client = boto3.client('dynamodbstreams') # Replace with your stream ARN stream_arn = 'arn:aws:dynamodb:us-east-1:123456789012:table/Users/stream/2023-10-26T10:00:00Z' response = client.get_records( ShardIterator=client.get_shard_iterator(ShardId='shardId-000000000000', StreamARN=stream_arn, ShardIteratorType='TRIM_HORIZON')['ShardIterator'] ) for record in response['Records']: print(record['dynamodb']) ``` -------------------------------- ### DynamoDB Table Creation Example Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/cs-CZ/NodeAutocompleteDocumentation.html Demonstrates how to create a new DynamoDB table with a primary key and provisioned throughput. ```javascript const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB(); const params = { TableName: 'NewTableName', KeySchema: [ { AttributeName: 'id', KeyType: 'HASH' // Partition key } ], AttributeDefinitions: [ { AttributeName: 'id', AttributeType: 'S' // String type } ], ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }; dynamoDb.createTable(params, (error, data) => { if (error) { console.error('Unable to create table. Error JSON:', JSON.stringify(error, null, 2)); } else { console.log('Table created successfully. Table description:', data.TableDescription); } }); ``` -------------------------------- ### DynamoDB TransactGetItems Command Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ja-JP/NodeAutocompleteDocumentation.html Performs multiple Get operations atomically. This example uses the TransactGetCommand. ```javascript import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; import { TransactGetCommand } from "@aws-sdk/lib-dynamodb"; const client = new DynamoDBClient({}); const main = async () => { const command = new TransactGetCommand({ TransactItems: [ { Get: { TableName: "users", Key: { email: "bob@example.com", }, }, }, { Get: { TableName: "users", Key: { email: "alice@example.com", }, }, }, ], }); const response = await client.send(command); console.log(response); }; main(); ``` -------------------------------- ### Shortest Lacing Example Source: https://github.com/dynamods/dynamo/wiki/Replication-and-Replication-Guide-Part-3 Represents the 'Shortest Lacing' option in Dynamo, which aims to append replication guides to arguments. Note: This lacing mode is currently known to have a bug where it should append replication guides but does not. ```Python # Shortest Lacing (Note: unfortunately, shortest lacing *is broken*: it should append Replication Guide to arguments. This issue will be fixed soon.) ``` -------------------------------- ### Get Mesh Edges as Six Numbers Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/NodeHelpFiles/en-GB/Autodesk.DesignScript.Geometry.Mesh.EdgesAsSixNumbers.md Use Mesh.EdgesAsSixNumbers to get the X, Y, and Z coordinates for each edge's vertices. This example demonstrates creating a cuboid mesh, extracting its edges, and reconstructing them. ```Python mesh = Mesh.Cuboid() edges = Mesh.EdgesAsSixNumbers(mesh) chopped_edges = List.Chop(edges, 6) start_points = chopped_edges.Map(lambda edge: Point.ByCoordinates(edge[0], edge[1], edge[2])) end_points = chopped_edges.Map(lambda edge: Point.ByCoordinates(edge[3], edge[4], edge[5])) reconstructed_edges = List.ByStartPointEndPoint(start_points, end_points) ``` -------------------------------- ### Install Mono on Ubuntu Source: https://github.com/dynamods/dynamo/wiki/Dynamo-on-Linux,-Mac Use this command to install the Mono complete package on Ubuntu systems. ```bash # sudo apt-get install mono-complete ``` -------------------------------- ### Initialize Sample Window in XAML.cs Source: https://github.com/dynamods/dynamo/wiki/Dynamo-View-Extensions This C# code provides the basic interaction logic for the SampleWindow.xaml. It initializes the component when the window is created. No specific setup is required beyond standard WPF window initialization. ```csharp using System.Windows; namespace SampleViewExtension { /// /// Interaction logic for SampleWindow.xaml /// public partial class SampleWindow : Window { public SampleWindow() { InitializeComponent(); } } } ``` -------------------------------- ### DynamoDB Batch Get Items with Specific Return Values Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of performing a batch get operation and specifying return values. Note that BatchGetItem does not have a direct 'ReturnValues' parameter; projection is used instead. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_specific_return_values(request_items, projection_expression=None): dynamodb = boto3.resource('dynamodb') # Note: BatchGetItem operation does not have a 'ReturnValues' parameter. # ProjectionExpression is used to control which attributes are returned. print("BatchGetItem operation uses ProjectionExpression, not ReturnValues.") response = dynamodb.batch_get_item( RequestItems=request_items, ProjectionExpression=projection_expression ) return response ``` -------------------------------- ### RecordableCommand Example Source: https://github.com/dynamods/dynamo/wiki/Dynamo-2.0 Demonstrates the concept of RecordableCommand types wrapping method calls for command playback, suggesting the wrapped methods should be public and the infrastructure moved. ```csharp RecordableCommand types ``` -------------------------------- ### DynamoDB Batch Get Items with All New and Old Values Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of performing a batch get operation and returning all new and old values. Note that BatchGetItem does not directly support returning new/old values. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_all_new_and_old_values(request_items): dynamodb = boto3.resource('dynamodb') # Note: BatchGetItem operation does not support returning 'ALL_NEW' or 'ALL_OLD' values. print("BatchGetItem operation does not support returning ALL_NEW or ALL_OLD values.") response = dynamodb.batch_get_item( RequestItems=request_items ) return response ``` -------------------------------- ### DynamoDB Batch Get Items with Return Values Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of performing a batch get operation and specifying return values. Note that 'ReturnValues' is not a direct parameter for BatchGetItem; it applies to individual item operations. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_return_values(request_items): dynamodb = boto3.resource('dynamodb') # Note: BatchGetItem operation does not have a 'ReturnValues' parameter. # Return values are determined by the ProjectionExpression or lack thereof. print("BatchGetItem operation does not support a 'ReturnValues' parameter.") response = dynamodb.batch_get_item( RequestItems=request_items ) return response ``` -------------------------------- ### DynamoViewModel Start Configuration Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/PublicAPI.Shipped.txt Details on configuring the start-up behavior and resources for Dynamo. ```APIDOC ## DynamoViewModel Start Configuration ### Description Manages various settings related to the initial configuration and branding of Dynamo. ### Class `Dynamo.ViewModels.DynamoViewModel.StartConfiguration` ### Properties - **BrandingResourceProvider**: Provides branding resources. - **CommandFilePath**: Path to the command file. - **DynamoModel**: The Dynamo model instance. - **HideReportOptions**: Boolean to hide report options. - **ShowLogin**: Boolean to show the login interface. - **Watch3DViewModel**: The ViewModel for the 3D watch window. - **WatchHandler**: Handler for watch functionality. ### Constructors - **StartConfiguration()**: Default constructor. ``` -------------------------------- ### Post Pre-release Packages to NuGet Gallery Source: https://github.com/dynamods/dynamo/blob/master/tools/NuGet/README.md Run this script to post pre-release packages to NuGet Gallery. Supply the NuGet Gallery API Key as the first parameter. ```bash PostNugetPackages.bat ``` -------------------------------- ### Get DynamoDB Item Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/zh-CN/Controls/NodeAutocompleteDocumentation.html Example of retrieving a specific item from a DynamoDB table using the GetItem operation. ```JSON { "TableName": "Orders", "Key": { "UserID": {"S": "user123"}, "OrderID": {"N": "456"} } } ``` -------------------------------- ### Initialize Dictionary using Dictionary.ByKeysValues Source: https://github.com/dynamods/dynamo/wiki/Dynamo-2.0-Language-Changes-Explained Shows how to initialize a dictionary using the `Dictionary.ByKeysValues` zero-touch method, which allows for more versatility and supports replication guides. ```DesignScript Dictionary.ByKeysValues(keyList, valueList); ``` -------------------------------- ### GuideBackground Properties, Constructors, and Methods Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/PublicAPI.Shipped.txt Provides details on the properties, constructors, and methods of the GuideBackground view. ```APIDOC ## Dynamo.Wpf.Views.GuidedTour.GuideBackground ### Properties - **CutOffBackgroundArea** (Dynamo.Wpf.UI.GuidedTour.CutOffArea) - Gets or sets the cutoff background area. - **HighlightBackgroundArea** (Dynamo.Wpf.UI.GuidedTour.HighlightArea) - Gets or sets the highlight background area. - **OverlayRect** (System.Windows.Rect) - Gets or sets the overlay rectangle. ### Constructors - **GuideBackground(System.Windows.Window mainWindow)** - Initializes a new instance of the GuideBackground class. ### Methods - **Dispose()** - Disposes the GuideBackground object. - **InitializeComponent()** - Initializes the components of the GuideBackground. ``` -------------------------------- ### DynamoDB Batch Get Items with Expression Attribute Values Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of using expression attribute values in batch get operations for DynamoDB. This allows retrieval of items with attribute values that conflict with reserved words. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_expression_attribute_values(request_items, expression_attribute_values): dynamodb = boto3.resource('dynamodb') response = dynamodb.batch_get_item( RequestItems=request_items, ExpressionAttributeValues=expression_attribute_values ) return response ``` -------------------------------- ### DynamoDB Batch Get Items with Expression Attribute Names Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/en-US/Controls/NodeAutocompleteDocumentation.html Example of using expression attribute names in batch get operations for DynamoDB. This allows retrieval of items with attribute names that conflict with reserved words. ```python from boto3.dynamodb.conditions import Key from decimal import Decimal import boto3 def batch_get_items_expression_attribute_names(request_items, expression_attribute_names): dynamodb = boto3.resource('dynamodb') response = dynamodb.batch_get_item( RequestItems=request_items, ExpressionAttributeNames=expression_attribute_names ) return response ``` -------------------------------- ### Install Pip using get-pip.py Source: https://github.com/dynamods/dynamo/wiki/Customizing-Dynamo's-Python-3-installation Execute this command in the Command Prompt after navigating to your Python home directory to download and install pip. Warnings about PATH can be ignored as they do not affect Dynamo. ```bash python get-pip.py ``` -------------------------------- ### DynamoDB Client - Get Table Size Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ja-JP/NodeAutocompleteDocumentation.html Retrieves the size of a DynamoDB table in bytes. This example uses the DescribeTableCommand. ```javascript import { DynamoDBClient, DescribeTableCommand } from "@aws-sdk/client-dynamodb"; const client = new DynamoDBClient({}); const main = async () => { const command = new DescribeTableCommand({ TableName: "products", }); const response = await client.send(command); console.log(response.Table.TableSizeBytes); }; main(); ``` -------------------------------- ### DynamoDB Backup and Restore Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/es-ES/Controls/NodeAutocompleteDocumentation.html Conceptual example of initiating a DynamoDB backup and restoring it. Actual implementation involves AWS SDK or CLI commands. ```bash # Initiate a backup aws dynamodb create-backup --table-name MyTable --backup-name MyBackup --region us-east-1 # List backups aws dynamodb list-backups --table-name-filter MyTable --region us-east-1 # Restore from backup # (Requires backup ARN from list-backups command) aws dynamodb restore-table-from-backup --target-table-name MyRestoredTable --backup-arn arn:aws:dynamodb:us-east-1:123456789012:table/MyTable/backup/backup-00000000000000000001 --region us-east-1 ``` -------------------------------- ### DynamoDB ListTables Example (AWS CLI) Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/cs-CZ/Controls/NodeAutocompleteDocumentation.html Demonstrates how to list all DynamoDB tables in a specific AWS region using the AWS CLI. ```bash aws dynamodb list-tables \ --region us-east-1 ``` -------------------------------- ### DynamoDB Client - Get Table Metrics Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ja-JP/NodeAutocompleteDocumentation.html Retrieves CloudWatch metrics for a DynamoDB table. This example uses the GetTableMetricsCommand. ```javascript import { DynamoDBClient, GetTableMetricsCommand } from "@aws-sdk/client-dynamodb"; const client = new DynamoDBClient({}); const main = async () => { const command = new GetTableMetricsCommand({ TableName: "products", MetricName: "SuccessfulRequestLatency", StartTime: new Date(Date.now() - 3600000), // Last hour EndTime: new Date(), }); const response = await client.send(command); console.log(response); }; main(); ``` -------------------------------- ### DynamoDB Batch Get Item Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/zh-CN/Controls/NodeAutocompleteDocumentation.html Example of retrieving multiple items from one or more DynamoDB tables in a single request. ```JSON { "RequestItems": { "Orders": { "Keys": [ { "UserID": {"S": "user123"}, "OrderID": {"N": "456"} }, { "UserID": {"S": "user456"}, "OrderID": {"N": "789"} } ] } } } ``` -------------------------------- ### DynamoDB Table Creation Example Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/es-ES/Controls/NodeAutocompleteDocumentation.html This snippet demonstrates the creation of a DynamoDB table with specific attributes and provisioned throughput. Ensure you have the necessary AWS SDK configured. ```javascript const AWS = require("aws-sdk"); AWS.config.update({ region: "us-east-1" }); const dynamodb = new AWS.DynamoDB(); const params = { AttributeDefinitions: [ { AttributeName: "CUSTOMER_ID", AttributeType: "S" } ], KeySchema: [ { AttributeName: "CUSTOMER_ID", KeyType: "HASH" } ], ProvisionedThroughput: { ReadCapacityUnits: 1, WriteCapacityUnits: 1 }, TableName: "ExampleTableForErrors" }; dynamodb.createTable(params, function(err, data) { if (err) { console.error("Unable to create table. Error JSON:", JSON.stringify(err, null, 2)); } else { console.log("Created table. Table description JSON:", JSON.stringify(data, null, 2)); } }); ``` -------------------------------- ### DynamoDB Client - Get Item Count Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ja-JP/NodeAutocompleteDocumentation.html Retrieves the approximate item count for a DynamoDB table. This example uses the DescribeTableCommand. ```javascript import { DynamoDBClient, DescribeTableCommand } from "@aws-sdk/client-dynamodb"; const client = new DynamoDBClient({}); const main = async () => { const command = new DescribeTableCommand({ TableName: "products", }); const response = await client.send(command); console.log(response.Table.ItemCount); }; main(); ``` -------------------------------- ### DynamoDB Table Creation Example (AWS CLI) Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/cs-CZ/Controls/NodeAutocompleteDocumentation.html Shows how to create a DynamoDB table using the AWS Command Line Interface (CLI). This command defines the table name, primary key schema, and provisioned throughput. ```bash aws dynamodb create-table \ --table-name YourTableName \ --attribute-definitions \ AttributeName=id,AttributeType=S \ --key-schema \ AttributeName=id,KeyType=HASH \ --provisioned-throughput \ ReadCapacityUnits=5,WriteCapacityUnits=5 \ --region us-east-1 ``` -------------------------------- ### DynamoDB Client - Get TTL Specification Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/ja-JP/NodeAutocompleteDocumentation.html Retrieves the Time To Live (TTL) specification for a DynamoDB table. This example uses the DescribeTableCommand. ```javascript import { DynamoDBClient, DescribeTableCommand } from "@aws-sdk/client-dynamodb"; const client = new DynamoDBClient({}); const main = async () => { const command = new DescribeTableCommand({ TableName: "products", }); const response = await client.send(command); console.log(response.Table.TimeToLiveSpecification); }; main(); ``` -------------------------------- ### View Startup Parameters Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/PublicAPI.Shipped.txt Contains parameters available during the startup of a view. ```APIDOC ## View Startup Parameters ### Description Provides access to core services and configurations available at view startup. ### Class: `ViewStartupParams` #### Property: `ExtensionManager` - **Description**: Gets the extension manager. - **Signature**: `Dynamo.Extensions.IExtensionManager ExtensionManager { get; }` ``` -------------------------------- ### Basic Data Structure Example Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/ja-JP/Controls/NodeAutocompleteDocumentation.html Illustrates a basic data structure, likely for use with DynamoDB. No specific setup or imports are shown. ```json { "id": "123", "name": "Example Item", "details": { "attribute1": "value1", "attribute2": 123 } } ``` -------------------------------- ### DynamoDB Backup Example (AWS SDK for JavaScript) Source: https://github.com/dynamods/dynamo/blob/master/src/DynamoCoreWpf/Controls/Docs/de-DE/NodeAutocompleteDocumentation.html Demonstrates how to create a backup of a DynamoDB table using the AWS SDK for JavaScript. Backups are useful for disaster recovery and compliance. ```javascript const AWS = require('aws-sdk'); AWS.config.update({ region: 'us-east-1' }); const dynamodb = new AWS.DynamoDB(); const params = { TableName: 'YourTableName', BackupName: 'MyTableBackup-' + new Date().toISOString().replace(/[:.]/g, '-') }; dynamodb.createBackup(params, (err, data) => { if (err) { console.error('Unable to create backup. Error JSON:', JSON.stringify(err, null, 2)); } else { console.log('Backup created successfully:', JSON.stringify(data, null, 2)); } }); ``` -------------------------------- ### DynamoDB Transaction Get Example Source: https://github.com/dynamods/dynamo/blob/master/doc/distrib/html/ja-JP/Controls/NodeAutocompleteDocumentation.html Retrieves multiple items from multiple tables in a single atomic transaction using PartiQL. Ensures consistency. ```javascript import { ExecuteStatementCommand } from "@aws-sdk/lib-dynamodb"; import { ddbClient } from "./ddbClient.js"; const usersTable = "Users"; const ordersTable = "Orders"; // Assuming an Orders table exists const userId = "user-123"; const transactGetParams = { Statement: ` BEGIN TRANSACTION; SELECT * FROM "${usersTable}" WHERE userId = ?; SELECT * FROM "${ordersTable}" WHERE userId = ?; COMMIT TRANSACTION; `, Parameters: [userId, userId], }; export const executeTransactGetPartiQL = async () => { try { const data = await ddbClient.send(new ExecuteStatementCommand(transactGetParams)); console.log("TransactGet PartiQL Result:", data.Items); // Note: For multiple statements, 'data.Items' might be an array of results per statement. // You'll need to parse this structure based on the number of SELECT statements. return data.Items; } catch (error) { console.error("Error executing TransactGet PartiQL:", error); } }; executeTransactGetPartiQL(); ```