Exemplo n.º 1
0
        public async Task <ResourceGroupModel> GetAllResourceGroup(string email, string subid)
        {
            //string subid = this._configuration["accountsetting:subscriptionId"];
            //string subid = "6273fbea-8a11-498b-8218-02b6f4398e12";
            string             access_token  = _tokenDto.GetTokenString(email, _tokenResource.Value.manage);
            ResourceGroupModel resourceGroup = await this._resourceGroupDto.GetAllResource(subid, access_token);

            return(resourceGroup);
        }
Exemplo n.º 2
0
        //    private readonly IIoTHubResourceDto _ioTHubResourceDto;



        //public IoTHubResourceBus(IIoTHubResourceDto ioTHubResourceDto)
        //{
        //    this._ioTHubResourceDto = ioTHubResourceDto;

//        }
        public async Task <string> GetBySubId(string email, string subid)
        {
            string access_token = _tokenDto.GetTokenString(email, _tokenResource.Value.manage);

            //var accountModel= this._configuration.GetSection("appsettings").Value;
            //SubId = this._accountModel.subscriptionId;
            //subId = "6273fbea-8a11-498b-8218-02b6f4398e12";

            Model.ResponseModel.IoTHubResourceModel objs = null;
            //IoTHubResourceDto ioTHubResourceDto = new IoTHubResourceDto();
            objs = await this._ioTHubResourceDto.ListBySubId(subid, access_token);

            List <Model.IoTHubResourceViewModel> listBySubIdResponse = new List <Model.IoTHubResourceViewModel>();

            foreach (var ob in objs.value)
            {
                Model.IoTHubResourceViewModel ioTHubResource = new Model.IoTHubResourceViewModel();
                ioTHubResource.name           = ob.name;
                ioTHubResource.location       = ob.location;
                ioTHubResource.resourcegroup  = ob.resourcegroup;
                ioTHubResource.type           = ob.type;
                ioTHubResource.subscriptionid = ob.subscriptionid;
                listBySubIdResponse.Add(ioTHubResource);
            }
            string result = JsonConvert.SerializeObject(listBySubIdResponse);

            return(result);
        }
Exemplo n.º 3
0
        public async Task <object> ListAllAKS(string email, string subid)
        {
            string access_token = _tokenDto.GetTokenString(email, _tokenResource.Value.manage);

            return(await this._aKSDto.ListAllAKS(subid, access_token));
        }
Exemplo n.º 4
0
        public async Task <object> LogQuery(string email, AKSExcuteLogQuery logQuery)
        {
            string access_token = _tokenDto.GetTokenString(email, _tokenResource.Value.apilog);

            return(await _monitorDto.ExcuteLogQuery(logQuery, access_token));
        }