本文整理了Java中io.cattle.platform.core.model.Instance.getAgentId()
方法的一些代码示例,展示了Instance.getAgentId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getAgentId()
方法的具体详情如下:
包路径:io.cattle.platform.core.model.Instance
类名称:Instance
方法名:getAgentId
[英]Getter for cattle.instance.agent_id
.
[中]cattle.instance.agent_id
的Getter。
代码示例来源:origin: rancher/cattle
private List<Long> getAgentResource(Long accountId, List<Instance> instances) {
List<Long> agentIds = agentInstanceDao.getAgentProvider(SystemLabels.LABEL_AGENT_SERVICE_SCHEDULING_PROVIDER, accountId);
for (Instance instance : instances) {
if (agentIds.contains(instance.getAgentId())) {
return new ArrayList<>();
}
}
return agentIds;
}
代码示例来源:origin: rancher/cattle
@Override
public void deleteAgent(Instance instance) {
if (!shouldCreateAgent(instance) || instance.getAgentId() == null) {
return;
}
Agent agent = objectManager.loadResource(Agent.class, instance.getAgentId());
if (agent == null) {
return;
}
if (CommonStatesConstants.DEACTIVATING.equals(agent.getState())) {
return;
}
try {
processManager.scheduleStandardProcess(StandardProcess.DEACTIVATE, agent,
ProcessUtils.chainInData(new HashMap<String, Object>(), AgentConstants.PROCESS_DEACTIVATE, AgentConstants.PROCESS_REMOVE));
} catch (ProcessCancelException e) {
try {
processManager.scheduleStandardProcess(StandardProcess.REMOVE, agent, null);
} catch (ProcessCancelException e1) {
}
}
}
代码示例来源:origin: rancher/cattle
@Override
protected Object getAgentResource(ProcessState state, ProcessInstance process, Object dataResource) {
Instance instance = getInstance(state);
if (!isPod(instance)) {
return false;
}
Long accountId = instance.getAccountId();
List<Long> agentIds = agentInstanceDao.getAgentProvider(SystemLabels.LABEL_AGENT_SERVICE_LABELS_PROVIDER, accountId);
Long agentId = agentIds.size() == 0 ? null : agentIds.get(0);
if ((instance instanceof Instance) && (agentIds.contains(instance.getAgentId()) || instance.getSystem())) {
return null;
}
if (agentId == null) {
if (k8sRequired(instance)) {
throw new ExecutionException("Failed to find labels provider", instance);
} else {
return null;
}
}
return agentId;
}
代码示例来源:origin: rancher/cattle
Agent agent = objectManager.loadResource(Agent.class, instance.getAgentId());
if (agent == null) {
return;
代码示例来源:origin: rancher/cattle
deleteAgentAccount(instance.getAgentId(), state.getData());
代码示例来源:origin: rancher/cattle
setZoneId(from.getZoneId());
setInstanceTriggeredStop(from.getInstanceTriggeredStop());
setAgentId(from.getAgentId());
setDomain(from.getDomain());
setFirstRunning(from.getFirstRunning());
内容来源于网络,如有侵权,请联系作者删除!