Пример #1
0
 public InputsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient        = apiClientFactory.CreateClient <IInputsApiClient>();
     Type              = new TypeApi(apiClientFactory);
     Rtmp              = new RtmpApi(apiClientFactory);
     RedundantRtmp     = new RedundantRtmpApi(apiClientFactory);
     S3                = new S3Api(apiClientFactory);
     S3RoleBased       = new S3RoleBasedApi(apiClientFactory);
     GenericS3         = new GenericS3Api(apiClientFactory);
     Local             = new LocalApi(apiClientFactory);
     Gcs               = new GcsApi(apiClientFactory);
     GcsServiceAccount = new GcsServiceAccountApi(apiClientFactory);
     Azure             = new AzureApi(apiClientFactory);
     Ftp               = new FtpApi(apiClientFactory);
     Sftp              = new SftpApi(apiClientFactory);
     Http              = new HttpApi(apiClientFactory);
     Https             = new HttpsApi(apiClientFactory);
     Aspera            = new AsperaApi(apiClientFactory);
     AkamaiNetstorage  = new AkamaiNetstorageApi(apiClientFactory);
     Srt               = new SrtApi(apiClientFactory);
     Tcp               = new TcpApi(apiClientFactory);
     Udp               = new UdpApi(apiClientFactory);
     UdpMulticast      = new UdpMulticastApi(apiClientFactory);
     Zixi              = new ZixiApi(apiClientFactory);
 }
Пример #2
0
        internal static Uri GetAzureUrl(LazyUri url)
        {
            var container = GetAzureContainer(url);
            var name      = GetFileCachePath(url);

            return(AzureApi.GetUrlForBlob(container, name));
        }
 public InfrastructureApi(IBitmovinApiClientFactory apiClientFactory)
 {
     Aws                   = new AwsApi(apiClientFactory);
     StaticIps             = new StaticIpsApi(apiClientFactory);
     Azure                 = new AzureApi(apiClientFactory);
     Gce                   = new GceApi(apiClientFactory);
     PrewarmedEncoderPools = new PrewarmedEncoderPoolsApi(apiClientFactory);
 }
Пример #4
0
 private static void InitAzureStorageAccount(string v)
 {
     AzureApi = (ICompactAzureApi)Activator.CreateInstance(AzureApiTypeImpl);
     AzureApi.Init(v);
     // Once per blob client
     //var props = blob.GetServiceProperties();
     //props.DefaultServiceVersion = "2014-02-14";
     //blob.SetServiceProperties(props);
     // return blob;
 }
Пример #5
0
        private static async Task DeleteAzureBlobAsync(LazyUri url)
        {
            var c = GetAzureContainer(url);
            var m = await GetAzureCachedFiles(c);

            var name = Caching.GetFileCachePath(url);

            if (m.Contains(name))
            {
                await AzureApi.DeleteBlob(c, name);
            }
        }
        public async Task <string> GetAsync()
        {
            AzureApi api = new AzureApi();

            string bearerToken = await api.GetBearerTokenAsync();

            //return await api.CreateVm(bearerToken);
            await api.GetAllVmAsync(bearerToken);

            return("");
            //return await api.RemoveVmWithTags(bearerToken, "Tezt", "wabaduu");
            //await api.CreateVm(bearerToken);
        }
Пример #7
0
 public OutputsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient        = apiClientFactory.CreateClient <IOutputsApiClient>();
     Type              = new TypeApi(apiClientFactory);
     S3                = new S3Api(apiClientFactory);
     S3RoleBased       = new S3RoleBasedApi(apiClientFactory);
     GenericS3         = new GenericS3Api(apiClientFactory);
     Local             = new LocalApi(apiClientFactory);
     Gcs               = new GcsApi(apiClientFactory);
     GcsServiceAccount = new GcsServiceAccountApi(apiClientFactory);
     Azure             = new AzureApi(apiClientFactory);
     Ftp               = new FtpApi(apiClientFactory);
     Sftp              = new SftpApi(apiClientFactory);
     AkamaiMsl         = new AkamaiMslApi(apiClientFactory);
     AkamaiNetstorage  = new AkamaiNetstorageApi(apiClientFactory);
     LiveMediaIngest   = new LiveMediaIngestApi(apiClientFactory);
 }
        protected override async void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(sender, e);

            if (e.PropertyName == nameof(FaceDetected) && FaceDetected != null)
            {
                try
                {
                    IsLoading = true;
                    RaisePropertyChanged(nameof(IsLoading));

                    IEnumerable <FaceModel> faces = await Task.Run(async() => await AzureApi.GetFacesAsync(FaceDetected));

                    foreach (FaceModel face in faces)
                    {
                        StringBuilder builder = new StringBuilder();
                        builder.AppendLine($"Age: {face.FaceAttributes.Age}");
                        builder.AppendLine($"Gender: {face.FaceAttributes.Gender}");
                        string hairColor = face.FaceAttributes.Hair.HairColor.OrderByDescending(hc => hc.Confidence).FirstOrDefault().Color;
                        builder.AppendLine($"HairColor: {hairColor}");
                        builder.AppendLine($"Beard: {face.FaceAttributes.FacialHair.Beard}");
                        builder.AppendLine($"Moustache: {face.FaceAttributes.FacialHair.Moustache}");
                        builder.AppendLine($"Smile: {face.FaceAttributes.Smile}");

                        builder.AppendLine();

                        builder.AppendLine("--EMOTIONS--");
                        builder.AppendLine($"Anger: {face.FaceAttributes.Emotion.Anger}");
                        builder.AppendLine($"Contempt: {face.FaceAttributes.Emotion.Contempt}");
                        builder.AppendLine($"Disgust: {face.FaceAttributes.Emotion.Disgust}");
                        builder.AppendLine($"Fear: {face.FaceAttributes.Emotion.Fear}");
                        builder.AppendLine($"Happiness: {face.FaceAttributes.Emotion.Happiness}");
                        builder.AppendLine($"Neutral: {face.FaceAttributes.Emotion.Neutral}");
                        builder.AppendLine($"Sadness: {face.FaceAttributes.Emotion.Sadness}");
                        builder.AppendLine($"Surprise: {face.FaceAttributes.Emotion.Surprise}");

                        _viewModelService.ShowMessage(builder.ToString(), "Face informations", MessageBoxButton.OK);
                    }
                }
                finally
                {
                    IsLoading = false;
                    RaisePropertyChanged(nameof(IsLoading));
                }
            }
        }
Пример #9
0
        internal static Task <HashSet <string> > GetAzureCachedFiles(string container)
        {
            ObjectManager.AssertMainThread();
            if (CachedFiles == null)
            {
                CachedFiles = new Dictionary <string, Task <HashSet <string> > >();
            }
            var m = CachedFiles.TryGetValue(container);

            if (m == null)
            {
                m = AzureApi.GetAzureCachedFilesInternal(container);
                CachedFiles[container] = m;
            }

            return(m);
        }
Пример #10
0
        static async Task AnalyzeSuspect(string imageFilePath)
        {
            byte[] byteData = GetImageAsByteArray(imageFilePath);
            IEnumerable <FaceModel> faces = await AzureApi.GetFacesAsync(byteData);

            if (!faces.Any())
            {
                System.Console.WriteLine("No suspect found.");
                System.Console.WriteLine();
                return;
            }

            int suspectNumber = 1;

            foreach (FaceModel face in faces)
            {
                PrintFaceDetails(face, suspectNumber++);
            }
        }
Пример #11
0
 public VmController(
     GameHandler gameHandler,
     PlayerGameHandler pgh,
     GameTaskHandler gth,
     TaskHandler th,
     PlayerTaskHandler pth,
     AzureApi aapi,
     VirtualMachineHandler vmh,
     IUserHandler userHandler
     )
 {
     this.gameHandler = gameHandler;
     this.pgh         = pgh;
     this.gth         = gth;
     this.th          = th;
     this.pth         = pth;
     this.aapi        = aapi;
     this.vmh         = vmh;
     this.userHandler = userHandler;
 }
Пример #12
0
        internal static async Task <HttpResponseMessage> GetAzureResponseAsync(string container, string name, long startPosition, Shaman.Types.WebFile file)
        {
            var options = new WebRequestOptions()
            {
                Timeout = 30000, TimeoutSecondRetrialAfterError = 10000, TimeoutStartSecondRetrial = null
            };

            if (startPosition != 0)
            {
                options.AddHeader("Range", "bytes=" + startPosition + "-");
            }
            var response = (await ExtensionMethods.SendAsync(new LazyUri(AzureApi.GetUrlForBlob(container, name)), options, null)).Response;
            IEnumerable <string> errs;

            if (response.Headers.TryGetValues("x-ms-meta-err", out errs))
            {
                throw MediaStream.ExceptionFromCachedResponse(errs.First());
            }

            return(response);
        }
        protected override async Task Handle(StatusRequest <AzureResourceWidget> request, CancellationToken cancellationToken)
        {
            if (request.Context.Location.Equals("global"))
            {
                return;
            }

            var api = new AzureApi(Endpoint);

            var resourceHealth = await api.GetResourceHealthAsync(request.Context.ResourceId);

            if (resourceHealth?.Properties != null && resourceHealth.Properties.TryGetValue(_availabilityStateKey, out var availabilityState))
            {
                request.Context.Status = availabilityState switch
                {
                    "Available" => Status.OK,
                    "Unknown" => Status.Unknown,
                    "Degraded" => Status.Failed,
                    "Unavailable" => Status.Stopped,
                    _ => Status.None
                };
            }
        }
    }
Пример #14
0
 public OutputsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     Azure             = new AzureApi(apiClientFactory);
     S3RoleBased       = new S3RoleBasedApi(apiClientFactory);
     GcsServiceAccount = new GcsServiceAccountApi(apiClientFactory);
 }