create_agreement
async
¶
create_agreement(
server_id: ServerId,
local_profile_id: ProfileId,
partner_profile_id: ProfileId,
access_role: Role,
*,
config_overrides: Optional[AsyncTransferClientConfig] = None,
description: Optional[Description] = None,
base_directory: Optional[HomeDirectory] = None,
status: Optional[AgreementStatusType] = None,
tags: Optional[Tags] = None,
preserve_filename: Optional[PreserveFilenameType] = None,
enforce_message_signing: Optional[EnforceMessageSigningType] = None,
custom_directories: Optional[CustomDirectoriesType] = None,
) -> CreateAgreementResponse
Creates an agreement. An agreement is a bilateral trading partner agreement, or partnership, between an Transfer Family server and an AS2 process. The agreement defines the file and message transfer relationship between the server and the AS2 process. To define an agreement, Transfer Family combines a server, local profile, partner profile, certificate, and other attributes.
The partner is identified with the PartnerProfileId, and the AS2 process is identified with the LocalProfileId.
Specify either BaseDirectory or CustomDirectories, but not both. Specifying both causes the command to fail.
Parameters:
-
description(Optional[Description], default:None) –A name or short description to identify the agreement.
-
server_id(ServerId) –A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
-
local_profile_id(ProfileId) –A unique identifier for the AS2 local profile.
-
partner_profile_id(ProfileId) –A unique identifier for the partner profile used in the agreement.
-
base_directory(Optional[HomeDirectory], default:None) –The landing directory (folder) for files transferred by using the AS2 protocol.
A
BaseDirectoryexample is/amzn-s3-demo-bucket/home/mydirectory. -
access_role(Role) –Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon Resource Name (ARN) of the Identity and Access Management role to use.
For AS2 connectors
With AS2, you can send files by calling
StartFileTransferand specifying the file paths in the request parameter,SendFilePaths. We use the file’s parent directory (for example, for--send-file-paths /bucket/dir/file.txt, parent directory is/bucket/dir/) to temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a final JSON file containing relevant metadata of the transmission. So, theAccessRoleneeds to provide read and write access to the parent directory of the file location used in theStartFileTransferrequest. Additionally, you need to provide read and write access to the parent directory of the files that you intend to send withStartFileTransfer.If you are using Basic authentication for your AS2 connector, the access role requires the
secretsmanager:GetSecretValuepermission for the secret. If the secret is encrypted using a customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs thekms:Decryptpermission for that key.For SFTP connectors
Make sure that the access role provides read and write access to the parent directory of the file location that's used in the
StartFileTransferrequest. Additionally, make sure that the role providessecretsmanager:GetSecretValuepermission to Secrets Manager. -
status(Optional[AgreementStatusType], default:None) –The status of the agreement. The agreement can be either
ACTIVEorINACTIVE. -
tags(Optional[Tags], default:None) –Key-value pairs that can be used to group and search for agreements.
-
preserve_filename(Optional[PreserveFilenameType], default:None) –Determines whether or not Transfer Family appends a unique string of characters to the end of the AS2 message payload filename when saving it.
-
ENABLED: the filename provided by your trading parter is preserved when the file is saved. -
DISABLED(default value): when Transfer Family saves the file, the filename is adjusted, as described in File names and locations.
-
-
enforce_message_signing(Optional[EnforceMessageSigningType], default:None) –Determines whether or not unsigned messages from your trading partners will be accepted.
-
ENABLED: Transfer Family rejects unsigned messages from your trading partner. -
DISABLED(default value): Transfer Family accepts unsigned messages from your trading partner.
-
-
custom_directories(Optional[CustomDirectoriesType], default:None) –A
CustomDirectoriesTypestructure. This structure specifies custom directories for storing various AS2 message files. You can specify directories for the following types of files.-
Failed files
-
MDN files
-
Payload files
-
Status files
-
Temporary files
-
Raises:
-
InternalServiceError–This exception is thrown when an error occurs in the Transfer Family service.
-
InvalidRequestException–This exception is thrown when the client submits a malformed request.
-
ResourceExistsException–The requested resource does not exist, or exists in a region other than the one specified for the command.
-
ResourceNotFoundException–This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.
-
ServiceUnavailableException–The request has failed because the Amazon Web ServicesTransfer Family service is not available.
-
ThrottlingException–The request was denied due to request throttling.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_transfer/_services/async_transfer.py
2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 | |