代码拉取完成,页面将自动刷新
#ifndef __RECORDS_H__
#define __RECORDS_H__
// 获取域名解析记录用这个
//DescribeDomainRecordsOutcome describeDomainRecords(const Model::DescribeDomainRecordsRequest &request)const;
//void describeDomainRecordsAsync(const Model::DescribeDomainRecordsRequest& request, const DescribeDomainRecordsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
//DescribeDomainRecordsOutcomeCallable describeDomainRecordsCallable(const Model::DescribeDomainRecordsRequest& request) const;
// 获取子域名解析记录用这个
//DescribeSubDomainRecordsOutcome describeSubDomainRecords(const Model::DescribeSubDomainRecordsRequest &request)const;
//void describeSubDomainRecordsAsync(const Model::DescribeSubDomainRecordsRequest& request, const DescribeSubDomainRecordsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
//DescribeSubDomainRecordsOutcomeCallable describeSubDomainRecordsCallable(const Model::DescribeSubDomainRecordsRequest& request) const;
//更新域名解析记录
//UpdateDomainRecordOutcome updateDomainRecord(const Model::UpdateDomainRecordRequest &request)const;
//void updateDomainRecordAsync(const Model::UpdateDomainRecordRequest& request, const UpdateDomainRecordAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
//UpdateDomainRecordOutcomeCallable updateDomainRecordCallable(const Model::UpdateDomainRecordRequest& request) const;
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/alidns/AlidnsClient.h>
#include <string>
#include <vector>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Alidns;
bool getRecordFromAlidns(const AlidnsClient& client, const std::string& domainName, const std::string& type, const std::string& subDomainName, std::string& ipv6Record, std::string& rr, std::string& id)
{
Model::DescribeSubDomainRecordsRequest dsdrr;
dsdrr.setDomainName(domainName);
dsdrr.setType(type);
dsdrr.setSubDomain(subDomainName);
AlidnsClient::DescribeSubDomainRecordsOutcome outcome = client.describeSubDomainRecords(dsdrr);
Model::DescribeSubDomainRecordsResult dsdrs = outcome.result();
if(!outcome.isSuccess())
{
return false;
}
auto vc = dsdrs.getDomainRecords();
for(auto i : vc)
{
ipv6Record = i.value;
rr = i.rR;
id = i.recordId;
}
return true;
}
void updateRecordToAlidns(const AlidnsClient& client, const std::string& rr, const std::string& value, const std::string& id, const std::string& type)
{
Model::UpdateDomainRecordRequest udrr;
udrr.setRR(rr);
udrr.setValue(value);
udrr.setRecordId(id);
udrr.setType(type);
client.updateDomainRecord(udrr);
}
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。