public HomeController(LogContext context, IAmazonSageMakerRuntime SageMakerClient, AccountContext accountContext) { _context = context; _SageMakerClient = SageMakerClient; _accountContext = accountContext; ipStackClient = new IpStackClient(Environment.GetEnvironmentVariable("IPSTACK_API_KEY")); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _sagemakerEndpoint = config.ReadText("EndpointName"); _runtimeClient = new AmazonSageMakerRuntimeClient(); }
private Amazon.SageMakerRuntime.Model.InvokeEndpointResponse CallAWSServiceOperation(IAmazonSageMakerRuntime client, Amazon.SageMakerRuntime.Model.InvokeEndpointRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Runtime", "InvokeEndpoint"); try { #if DESKTOP return(client.InvokeEndpoint(request)); #elif CORECLR return(client.InvokeEndpointAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
protected override void ProcessRecord() { base.ProcessRecord(); Client = CreateClient(_CurrentCredentials, _RegionEndpoint); }