C# Класс AWSSDK.Tests.Framework.UtilityMethods

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
FirehoseAssumeRolePolicyDocumentFormat string
LambdaAssumeRolePolicyDocument string

Открытые методы

Метод Описание
CreateFunctionIfNotExists ( AmazonLambdaClient client, string functionName, string functionHandlerName, string code, string iamRoleArn ) : string

Create a Lambda Function or return the ARN of the existing Lambda Function with the same name.

CreatePolicyIfNotExists ( IAmazonIdentityManagementService iamClient, string policyName, string policyDocument, string roleName ) : void
CreateRoleIfNotExists ( IAmazonIdentityManagementService iamClient, string roleName, string assumeRolePolicyDocument, bool waitForEventualConsistency = true ) : string
DoesRoleHavePolicy ( IAmazonIdentityManagementService iamClient, string policyName, string roleName ) : bool
GenerateName ( ) : string
GenerateName ( string name ) : string
GetFunctionArnIfExists ( IAmazonLambda lambdaClient, string functionName ) : string
GetRoleIfExists ( IAmazonIdentityManagementService iamClient, string roleName ) : Role

Приватные методы

Метод Описание
GetScriptStream ( string codeb64 ) : MemoryStream

Описание методов

CreateFunctionIfNotExists() публичный статический Метод

Create a Lambda Function or return the ARN of the existing Lambda Function with the same name.
public static CreateFunctionIfNotExists ( AmazonLambdaClient client, string functionName, string functionHandlerName, string code, string iamRoleArn ) : string
client Amazon.Lambda.AmazonLambdaClient
functionName string Name of lambda function.
functionHandlerName string The name of the .js file that contains the Lambda handler. /// e.g helloworld.js has functionHandlerName "helloworld".
code string The Base64-encoded zip file of the code to be used. The name of the file /// in the zip file that contains the Lambda functio handler should match functionHandlerName. /// .Net 2.0 does not support System.IO.Compression.ZipArchive so the process of creating the /// Base64-encoded zip file should be done outside of the test framework in the following way: /// private static string CreateScriptBytesBase64(string name, string script) /// { /// using (var stream = new MemoryStream()) /// { /// using (var archive = new ZipArchive(stream, ZipArchiveMode.Create, true)) /// { /// var entry = archive.CreateEntry(name + ".js"); /// using (var entryStream = entry.Open()) /// using (var writer = new StreamWriter(entryStream)) /// { /// writer.Write(script); /// } /// } /// var bytes = stream.ToArray(); /// var base64 = Convert.ToBase64String(bytes); /// return base64; /// } /// } ///
iamRoleArn string
Результат string

CreatePolicyIfNotExists() публичный статический Метод

public static CreatePolicyIfNotExists ( IAmazonIdentityManagementService iamClient, string policyName, string policyDocument, string roleName ) : void
iamClient IAmazonIdentityManagementService
policyName string
policyDocument string
roleName string
Результат void

CreateRoleIfNotExists() публичный статический Метод

public static CreateRoleIfNotExists ( IAmazonIdentityManagementService iamClient, string roleName, string assumeRolePolicyDocument, bool waitForEventualConsistency = true ) : string
iamClient IAmazonIdentityManagementService
roleName string
assumeRolePolicyDocument string
waitForEventualConsistency bool
Результат string

DoesRoleHavePolicy() публичный статический Метод

public static DoesRoleHavePolicy ( IAmazonIdentityManagementService iamClient, string policyName, string roleName ) : bool
iamClient IAmazonIdentityManagementService
policyName string
roleName string
Результат bool

GenerateName() публичный статический Метод

public static GenerateName ( ) : string
Результат string

GenerateName() публичный статический Метод

public static GenerateName ( string name ) : string
name string
Результат string

GetFunctionArnIfExists() публичный статический Метод

public static GetFunctionArnIfExists ( IAmazonLambda lambdaClient, string functionName ) : string
lambdaClient IAmazonLambda
functionName string
Результат string

GetRoleIfExists() публичный статический Метод

public static GetRoleIfExists ( IAmazonIdentityManagementService iamClient, string roleName ) : Role
iamClient IAmazonIdentityManagementService
roleName string
Результат Amazon.IdentityManagement.Model.Role

Описание свойств

FirehoseAssumeRolePolicyDocumentFormat публичное статическое свойство

public static string FirehoseAssumeRolePolicyDocumentFormat
Результат string

LambdaAssumeRolePolicyDocument публичное статическое свойство

public static string LambdaAssumeRolePolicyDocument
Результат string