mirror of https://github.com/apache/cloudstack.git
Merge remote-tracking branch 'upstream/main' into service_offering_category_feature
# Conflicts: # ui/src/views/offering/AddComputeOffering.vue
This commit is contained in:
commit
104cb32974
10
.asf.yaml
10
.asf.yaml
|
|
@ -50,16 +50,10 @@ github:
|
|||
rebase: false
|
||||
|
||||
collaborators:
|
||||
- acs-robot
|
||||
- gpordeus
|
||||
- hsato03
|
||||
- FelipeM525
|
||||
- lucas-a-martins
|
||||
- nicoschmdt
|
||||
- abh1sar
|
||||
- rosi-shapeblue
|
||||
- sudo87
|
||||
- erikbocks
|
||||
- Imvedansh
|
||||
- Damans227
|
||||
|
||||
protected_branches: ~
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
.github/workflows/*.lock.yml linguist-generated=true merge=ours
|
||||
|
|
@ -20,3 +20,5 @@
|
|||
|
||||
.pre-commit-config.yaml @jbampton
|
||||
/.github/linters/ @jbampton
|
||||
|
||||
/plugins/network-elements/nsx/ @Pearl1594 @nvazquez
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
# Mark all cached import files as generated
|
||||
* linguist-generated=true
|
||||
|
||||
# Use 'ours' merge strategy to keep local cached versions
|
||||
* merge=ours
|
||||
73
.github/aw/imports/github/gh-aw/94662b1dee8ce96c876ba9f33b3ab8be32de82a4/.github_workflows_shared_reporting.md
generated
vendored
Normal file
73
.github/aw/imports/github/gh-aw/94662b1dee8ce96c876ba9f33b3ab8be32de82a4/.github_workflows_shared_reporting.md
generated
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
---
|
||||
# Report formatting guidelines
|
||||
---
|
||||
|
||||
## Report Structure Guidelines
|
||||
|
||||
### 1. Header Levels
|
||||
**Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.**
|
||||
|
||||
When creating GitHub issues or discussions:
|
||||
- Use `###` (h3) for main sections (e.g., "### Test Summary")
|
||||
- Use `####` (h4) for subsections (e.g., "#### Device-Specific Results")
|
||||
- Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles
|
||||
|
||||
### 2. Progressive Disclosure
|
||||
**Wrap detailed test results in `<details><summary><b>Section Name</b></summary>` tags to improve readability and reduce scrolling.**
|
||||
|
||||
Use collapsible sections for:
|
||||
- Verbose details (full test logs, raw data)
|
||||
- Secondary information (minor warnings, extra context)
|
||||
- Per-item breakdowns when there are many items
|
||||
|
||||
Always keep critical information visible (summary, critical issues, key metrics).
|
||||
|
||||
### 3. Report Structure Pattern
|
||||
|
||||
1. **Overview**: 1-2 paragraphs summarizing key findings
|
||||
2. **Critical Information**: Show immediately (summary stats, critical issues)
|
||||
3. **Details**: Use `<details><summary><b>Section Name</b></summary>` for expanded content
|
||||
4. **Context**: Add helpful metadata (workflow run, date, trigger)
|
||||
|
||||
### Design Principles (Airbnb-Inspired)
|
||||
|
||||
Reports should:
|
||||
- **Build trust through clarity**: Most important info immediately visible
|
||||
- **Exceed expectations**: Add helpful context like trends, comparisons
|
||||
- **Create delight**: Use progressive disclosure to reduce overwhelm
|
||||
- **Maintain consistency**: Follow patterns across all reports
|
||||
|
||||
### Example Report Structure
|
||||
|
||||
```markdown
|
||||
### Summary
|
||||
- Key metric 1: value
|
||||
- Key metric 2: value
|
||||
- Status: ✅/⚠️/❌
|
||||
|
||||
### Critical Issues
|
||||
[Always visible - these are important]
|
||||
|
||||
<details>
|
||||
<summary><b>View Detailed Results</b></summary>
|
||||
|
||||
[Comprehensive details, logs, traces]
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>View All Warnings</b></summary>
|
||||
|
||||
[Minor issues and potential problems]
|
||||
|
||||
</details>
|
||||
|
||||
### Recommendations
|
||||
[Actionable next steps - keep visible]
|
||||
```
|
||||
|
||||
## Workflow Run References
|
||||
|
||||
- Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)`
|
||||
- Include up to 3 most relevant run URLs at end under `**References:**`
|
||||
- Do NOT add footer attribution (system adds automatically)
|
||||
|
|
@ -146,6 +146,7 @@ jobs:
|
|||
smoke/test_vm_snapshot_kvm
|
||||
smoke/test_vm_snapshots
|
||||
smoke/test_volumes
|
||||
smoke/test_vpc_conserve_mode
|
||||
smoke/test_vpc_ipv6
|
||||
smoke/test_vpc_redundant
|
||||
smoke/test_vpc_router_nics
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
description: |
|
||||
This workflow creates daily repo status reports. It gathers recent repository
|
||||
activity (issues, PRs, discussions, releases, code changes) and generates
|
||||
engaging GitHub issues with productivity insights, community highlights,
|
||||
and project recommendations.
|
||||
|
||||
on:
|
||||
schedule: daily
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
|
||||
network: defaults
|
||||
|
||||
tools:
|
||||
github:
|
||||
# If in a public repo, setting `lockdown: false` allows
|
||||
# reading issues, pull requests and comments from 3rd-parties
|
||||
# If in a private repo this has no particular effect.
|
||||
lockdown: false
|
||||
|
||||
safe-outputs:
|
||||
create-issue:
|
||||
title-prefix: "[repo-status] "
|
||||
labels: [report, daily-status]
|
||||
source: githubnext/agentics/workflows/daily-repo-status.md@d19056381ba48cb1f7c78510c23069701fa7ae87
|
||||
---
|
||||
|
||||
# Daily Repo Status
|
||||
|
||||
Create an upbeat daily status report for the repo as a GitHub issue.
|
||||
|
||||
## What to include
|
||||
|
||||
- Recent repository activity (issues, PRs, discussions, releases, code changes)
|
||||
- Progress tracking, goal reminders and highlights
|
||||
- Project status and recommendations
|
||||
- Actionable next steps for maintainers
|
||||
|
||||
## Style
|
||||
|
||||
- Be positive, encouraging, and helpful 🌟
|
||||
- Use emojis moderately for engagement
|
||||
- Keep it concise - adjust length based on actual activity
|
||||
|
||||
## Process
|
||||
|
||||
1. Gather recent activity from the repository
|
||||
2. Study the repository, its issues and its pull requests
|
||||
3. Create a new GitHub issue with your findings and insights
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
on:
|
||||
schedule: 0 14 * * 1-5
|
||||
workflow_dispatch: null
|
||||
permissions:
|
||||
issues: read
|
||||
imports:
|
||||
- github/gh-aw/.github/workflows/shared/reporting.md@94662b1dee8ce96c876ba9f33b3ab8be32de82a4
|
||||
safe-outputs:
|
||||
add-comment: {}
|
||||
add-labels:
|
||||
allowed:
|
||||
- bug
|
||||
- feature
|
||||
- enhancement
|
||||
- documentation
|
||||
- question
|
||||
- help-wanted
|
||||
- good-first-issue
|
||||
source: github/gh-aw/.github/workflows/issue-triage-agent.md@94662b1dee8ce96c876ba9f33b3ab8be32de82a4
|
||||
strict: true
|
||||
timeout-minutes: 5
|
||||
tools:
|
||||
github:
|
||||
toolsets:
|
||||
- issues
|
||||
- labels
|
||||
---
|
||||
# Issue Triage Agent
|
||||
|
||||
List open issues in ${{ github.repository }} that have no labels. For each unlabeled issue, analyze the title and body, then add one of the allowed labels: `bug`, `feature`, `enhancement`, `documentation`, `question`, `help-wanted`, or `good-first-issue`.
|
||||
|
||||
Skip issues that:
|
||||
- Already have any of these labels
|
||||
- Have been assigned to any user (especially non-bot users)
|
||||
|
||||
After adding the label to an issue, mention the issue author in a comment using this format (follow shared/reporting.md guidelines):
|
||||
|
||||
**Comment Template**:
|
||||
```markdown
|
||||
### 🏷️ Issue Triaged
|
||||
|
||||
Hi @{author}! I've categorized this issue as **{label_name}** based on the following analysis:
|
||||
|
||||
**Reasoning**: {brief_explanation_of_why_this_label}
|
||||
|
||||
<details>
|
||||
<summary><b>View Triage Details</b></summary>
|
||||
|
||||
#### Analysis
|
||||
- **Keywords detected**: {list_of_keywords_that_matched}
|
||||
- **Issue type indicators**: {what_made_this_fit_the_category}
|
||||
- **Confidence**: {High/Medium/Low}
|
||||
|
||||
#### Recommended Next Steps
|
||||
- {context_specific_suggestion_1}
|
||||
- {context_specific_suggestion_2}
|
||||
|
||||
</details>
|
||||
|
||||
**References**: [Triage run §{run_id}](https://github.com/github/gh-aw/actions/runs/{run_id})
|
||||
```
|
||||
|
||||
**Key formatting requirements**:
|
||||
- Use h3 (###) for the main heading
|
||||
- Keep reasoning visible for quick understanding
|
||||
- Wrap detailed analysis in `<details>` tags
|
||||
- Include workflow run reference
|
||||
- Keep total comment concise (collapsed details prevent noise)
|
||||
|
||||
## Batch Comment Optimization
|
||||
|
||||
For efficiency, if multiple issues are triaged in a single run:
|
||||
1. Add individual labels to each issue
|
||||
2. Add a brief comment to each issue (using the template above)
|
||||
3. Optionally: Create a discussion summarizing all triage actions for that run
|
||||
|
||||
This provides both per-issue context and batch visibility.
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
name: "PR Merge Conflict Check"
|
||||
on:
|
||||
push:
|
||||
pull_request_target:
|
||||
types: [synchronize]
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
permissions: # added using https://github.com/step-security/secure-workflows
|
||||
contents: read
|
||||
|
|
|
|||
|
|
@ -41,3 +41,9 @@ jobs:
|
|||
days-before-pr-close: 240
|
||||
exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan'
|
||||
exempt-pr-labels: 'status:ready-for-merge,status:needs-testing,status:on-hold'
|
||||
- uses: actions/stale@v10
|
||||
with:
|
||||
stale-issue-label: 'archive'
|
||||
days-before-stale: 240
|
||||
exempt-issue-labels: 'gsoc,good-first-issue,long-term-plan'
|
||||
days-before-close: -1
|
||||
|
|
|
|||
|
|
@ -52,6 +52,16 @@ repos:
|
|||
args: ['644']
|
||||
files: \.md$
|
||||
stages: [manual]
|
||||
- id: insert-license
|
||||
name: add license for all cfg files
|
||||
description: automatically adds a licence header to all cfg files that don't have a license header
|
||||
files: \.cfg$
|
||||
args:
|
||||
- --comment-style
|
||||
- '|#|'
|
||||
- --license-filepath
|
||||
- .github/workflows/license-templates/LICENSE.txt
|
||||
- --fuzzy-match-generates-todo
|
||||
- id: insert-license
|
||||
name: add license for all Markdown files
|
||||
files: \.md$
|
||||
|
|
@ -61,7 +71,7 @@ repos:
|
|||
- --license-filepath
|
||||
- .github/workflows/license-templates/LICENSE.txt
|
||||
- --fuzzy-match-generates-todo
|
||||
exclude: ^(CHANGES|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)\.md$|^ui/docs/(full|smoke)-test-plan\.template\.md$
|
||||
exclude: ^(CHANGES|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)\.md$|^ui/docs/(full|smoke)-test-plan\.template\.md$|^\.github/workflows/.*\.md$|^\.github/aw/.*\.md$
|
||||
- id: insert-license
|
||||
name: add license for all properties files
|
||||
description: automatically adds a licence header to all properties files that don't have a license header
|
||||
|
|
@ -110,6 +120,7 @@ repos:
|
|||
- --license-filepath
|
||||
- .github/workflows/license-templates/LICENSE.txt
|
||||
- --fuzzy-match-generates-todo
|
||||
exclude: ^\.github/workflows/.*\.lock\.yml$
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
|
|
@ -185,4 +196,4 @@ repos:
|
|||
args: [--config-file=.github/linters/.yamllint.yml]
|
||||
types: [yaml]
|
||||
files: \.ya?ml$
|
||||
exclude: ^.*k8s-.*\.ya?ml$
|
||||
exclude: ^.*k8s-.*\.ya?ml$|^.github/workflows/.*\.lock\.ya?ml$
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
|
|||
final Object resource = this;
|
||||
logger.info("Building class loader for com.cloud.consoleproxy.ConsoleProxy");
|
||||
if (consoleProxyMain == null) {
|
||||
logger.info("Running com.cloud.consoleproxy.ConsoleProxy with encryptor password={}", encryptorPassword);
|
||||
logger.info("Running com.cloud.consoleproxy.ConsoleProxy");
|
||||
consoleProxyMain = new Thread(new ManagedContextRunnable() {
|
||||
@Override
|
||||
protected void runInContext() {
|
||||
|
|
|
|||
|
|
@ -24,15 +24,18 @@ import com.cloud.network.Network;
|
|||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.command.admin.config.ResetCfgCmd;
|
||||
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.CloneNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.CreateGuestNetworkIpv6PrefixCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.CreateManagementNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteGuestNetworkIpv6PrefixCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteManagementNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.ListGuestNetworkIpv6PrefixesCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.NetworkOfferingBaseCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.network.UpdatePodManagementNetworkIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CloneDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CloneServiceOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCategoryCmd;
|
||||
|
|
@ -109,6 +112,33 @@ public interface ConfigurationService {
|
|||
*/
|
||||
ServiceOffering createServiceOffering(CreateServiceOfferingCmd cmd);
|
||||
|
||||
/**
|
||||
* Clones a service offering with optional parameter overrides
|
||||
*
|
||||
* @param cmd
|
||||
* the command object that specifies the source offering ID and optional parameter overrides
|
||||
* @return the newly created service offering cloned from source, null otherwise
|
||||
*/
|
||||
ServiceOffering cloneServiceOffering(CloneServiceOfferingCmd cmd);
|
||||
|
||||
/**
|
||||
* Clones a disk offering with optional parameter overrides
|
||||
*
|
||||
* @param cmd
|
||||
* the command object that specifies the source offering ID and optional parameter overrides
|
||||
* @return the newly created disk offering cloned from source, null otherwise
|
||||
*/
|
||||
DiskOffering cloneDiskOffering(CloneDiskOfferingCmd cmd);
|
||||
|
||||
/**
|
||||
* Clones a network offering with optional parameter overrides
|
||||
*
|
||||
* @param cmd
|
||||
* the command object that specifies the source offering ID and optional parameter overrides
|
||||
* @return the newly created network offering cloned from source, null otherwise
|
||||
*/
|
||||
NetworkOffering cloneNetworkOffering(CloneNetworkOfferingCmd cmd);
|
||||
|
||||
/**
|
||||
* Updates a service offering
|
||||
*
|
||||
|
|
@ -310,7 +340,7 @@ public interface ConfigurationService {
|
|||
|
||||
boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd);
|
||||
|
||||
NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd);
|
||||
NetworkOffering createNetworkOffering(NetworkOfferingBaseCmd cmd);
|
||||
|
||||
NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd);
|
||||
|
||||
|
|
|
|||
|
|
@ -298,8 +298,9 @@ public class EventTypes {
|
|||
public static final String EVENT_REGISTER_CNI_CONFIG = "REGISTER.CNI.CONFIG";
|
||||
public static final String EVENT_DELETE_CNI_CONFIG = "DELETE.CNI.CONFIG";
|
||||
|
||||
//register for user API and secret keys
|
||||
//user API and secret keys
|
||||
public static final String EVENT_REGISTER_FOR_SECRET_API_KEY = "REGISTER.USER.KEY";
|
||||
public static final String EVENT_DELETE_SECRET_API_KEY = "DELETE.USER.KEY";
|
||||
public static final String API_KEY_ACCESS_UPDATE = "API.KEY.ACCESS.UPDATE";
|
||||
|
||||
// Template Events
|
||||
|
|
@ -374,11 +375,13 @@ public class EventTypes {
|
|||
|
||||
// Service Offerings
|
||||
public static final String EVENT_SERVICE_OFFERING_CREATE = "SERVICE.OFFERING.CREATE";
|
||||
public static final String EVENT_SERVICE_OFFERING_CLONE = "SERVICE.OFFERING.CLONE";
|
||||
public static final String EVENT_SERVICE_OFFERING_EDIT = "SERVICE.OFFERING.EDIT";
|
||||
public static final String EVENT_SERVICE_OFFERING_DELETE = "SERVICE.OFFERING.DELETE";
|
||||
|
||||
// Disk Offerings
|
||||
public static final String EVENT_DISK_OFFERING_CREATE = "DISK.OFFERING.CREATE";
|
||||
public static final String EVENT_DISK_OFFERING_CLONE = "DISK.OFFERING.CLONE";
|
||||
public static final String EVENT_DISK_OFFERING_EDIT = "DISK.OFFERING.EDIT";
|
||||
public static final String EVENT_DISK_OFFERING_DELETE = "DISK.OFFERING.DELETE";
|
||||
|
||||
|
|
@ -399,6 +402,7 @@ public class EventTypes {
|
|||
|
||||
// Network offerings
|
||||
public static final String EVENT_NETWORK_OFFERING_CREATE = "NETWORK.OFFERING.CREATE";
|
||||
public static final String EVENT_NETWORK_OFFERING_CLONE = "NETWORK.OFFERING.CLONE";
|
||||
public static final String EVENT_NETWORK_OFFERING_ASSIGN = "NETWORK.OFFERING.ASSIGN";
|
||||
public static final String EVENT_NETWORK_OFFERING_EDIT = "NETWORK.OFFERING.EDIT";
|
||||
public static final String EVENT_NETWORK_OFFERING_REMOVE = "NETWORK.OFFERING.REMOVE";
|
||||
|
|
@ -583,6 +587,7 @@ public class EventTypes {
|
|||
|
||||
// Network ACL
|
||||
public static final String EVENT_NETWORK_ACL_CREATE = "NETWORK.ACL.CREATE";
|
||||
public static final String EVENT_NETWORK_ACL_IMPORT = "NETWORK.ACL.IMPORT";
|
||||
public static final String EVENT_NETWORK_ACL_DELETE = "NETWORK.ACL.DELETE";
|
||||
public static final String EVENT_NETWORK_ACL_REPLACE = "NETWORK.ACL.REPLACE";
|
||||
public static final String EVENT_NETWORK_ACL_UPDATE = "NETWORK.ACL.UPDATE";
|
||||
|
|
@ -597,6 +602,7 @@ public class EventTypes {
|
|||
|
||||
// VPC offerings
|
||||
public static final String EVENT_VPC_OFFERING_CREATE = "VPC.OFFERING.CREATE";
|
||||
public static final String EVENT_VPC_OFFERING_CLONE = "VPC.OFFERING.CLONE";
|
||||
public static final String EVENT_VPC_OFFERING_UPDATE = "VPC.OFFERING.UPDATE";
|
||||
public static final String EVENT_VPC_OFFERING_DELETE = "VPC.OFFERING.DELETE";
|
||||
|
||||
|
|
@ -629,6 +635,7 @@ public class EventTypes {
|
|||
|
||||
// Backup and Recovery events
|
||||
public static final String EVENT_VM_BACKUP_IMPORT_OFFERING = "BACKUP.IMPORT.OFFERING";
|
||||
public static final String EVENT_VM_BACKUP_OFFERING_CLONE = "BACKUP.OFFERING.CLONE";
|
||||
public static final String EVENT_VM_BACKUP_OFFERING_ASSIGN = "BACKUP.OFFERING.ASSIGN";
|
||||
public static final String EVENT_VM_BACKUP_OFFERING_REMOVE = "BACKUP.OFFERING.REMOVE";
|
||||
public static final String EVENT_VM_BACKUP_CREATE = "BACKUP.CREATE";
|
||||
|
|
@ -1044,11 +1051,13 @@ public class EventTypes {
|
|||
|
||||
// Service Offerings
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_CREATE, ServiceOffering.class);
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_CLONE, ServiceOffering.class);
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_EDIT, ServiceOffering.class);
|
||||
entityEventDetails.put(EVENT_SERVICE_OFFERING_DELETE, ServiceOffering.class);
|
||||
|
||||
// Disk Offerings
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_CREATE, DiskOffering.class);
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_CLONE, DiskOffering.class);
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_EDIT, DiskOffering.class);
|
||||
entityEventDetails.put(EVENT_DISK_OFFERING_DELETE, DiskOffering.class);
|
||||
|
||||
|
|
@ -1069,6 +1078,7 @@ public class EventTypes {
|
|||
|
||||
// Network offerings
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_CREATE, NetworkOffering.class);
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_CLONE, NetworkOffering.class);
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_ASSIGN, NetworkOffering.class);
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_EDIT, NetworkOffering.class);
|
||||
entityEventDetails.put(EVENT_NETWORK_OFFERING_REMOVE, NetworkOffering.class);
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ public interface Host extends StateObject<Status>, Identity, Partition, HAResour
|
|||
String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
|
||||
String HOST_OVFTOOL_VERSION = "host.ovftool.version";
|
||||
String HOST_VIRTV2V_VERSION = "host.virtv2v.version";
|
||||
String HOST_SSH_PORT = "host.ssh.port";
|
||||
|
||||
int DEFAULT_SSH_PORT = 22;
|
||||
|
||||
/**
|
||||
* @return name of the machine.
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public interface KubernetesCluster extends ControlledEntity, com.cloud.utils.fsm
|
|||
s_fsm.addTransition(State.Running, Event.ScaleDownRequested, State.Scaling);
|
||||
s_fsm.addTransition(State.Stopped, Event.ScaleUpRequested, State.ScalingStoppedCluster);
|
||||
s_fsm.addTransition(State.Scaling, Event.OperationSucceeded, State.Running);
|
||||
s_fsm.addTransition(State.Scaling, Event.OperationFailed, State.Alert);
|
||||
s_fsm.addTransition(State.Scaling, Event.OperationFailed, State.Running);
|
||||
s_fsm.addTransition(State.ScalingStoppedCluster, Event.OperationSucceeded, State.Stopped);
|
||||
s_fsm.addTransition(State.ScalingStoppedCluster, Event.OperationFailed, State.Alert);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package com.cloud.kubernetes.cluster;
|
|||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -33,8 +34,10 @@ public interface KubernetesServiceHelper extends Adapter {
|
|||
ControlledEntity findByUuid(String uuid);
|
||||
ControlledEntity findByVmId(long vmId);
|
||||
void checkVmCanBeDestroyed(UserVm userVm);
|
||||
void checkVmAffinityGroupsCanBeUpdated(UserVm userVm);
|
||||
boolean isValidNodeType(String nodeType);
|
||||
Map<String, Long> getServiceOfferingNodeTypeMap(Map<String, Map<String, String>> serviceOfferingNodeTypeMap);
|
||||
Map<String, Long> getTemplateNodeTypeMap(Map<String, Map<String, String>> templateNodeTypeMap);
|
||||
Map<String, List<Long>> getAffinityGroupNodeTypeMap(Map<String, Map<String, String>> affinityGroupNodeTypeMap);
|
||||
void cleanupForAccount(Account account);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,10 @@ public interface NetworkService {
|
|||
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType) throws
|
||||
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
|
||||
|
||||
Network createGuestNetwork(long networkOfferingId, String name, String displayText, Account owner,
|
||||
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType, Pair<Integer, Integer> vrIfaceMTUs) throws
|
||||
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
|
||||
|
||||
Pair<List<? extends Network>, Integer> searchForNetworks(ListNetworksCmd cmd);
|
||||
|
||||
boolean deleteNetwork(long networkId, boolean forced);
|
||||
|
|
@ -275,4 +279,6 @@ public interface NetworkService {
|
|||
IpAddresses getIpAddressesFromIps(String ipAddress, String ip6Address, String macAddress);
|
||||
|
||||
String getNicVlanValueForExternalVm(NicTO nic);
|
||||
|
||||
Long getPreferredNetworkIdForPublicIpRuleAssignment(IpAddress ip, Long networkId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public interface LoadBalancingRulesService {
|
|||
/**
|
||||
* Assign a virtual machine or list of virtual machines, or Map of <vmId vmIp> to a load balancer.
|
||||
*/
|
||||
boolean assignToLoadBalancer(long lbRuleId, List<Long> vmIds, Map<Long, List<String>> vmIdIpMap, boolean isAutoScaleVM);
|
||||
boolean assignToLoadBalancer(long lbRuleId, List<Long> vmIds, Map<Long, List<String>> vmIdIpMap, Map<Long, Long> vmIdNetworkMap, boolean isAutoScaleVM);
|
||||
|
||||
boolean assignSSLCertToLoadBalancerRule(Long lbRuleId, String certName, String publicCert, String privateKey);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package com.cloud.network.vpc;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.network.CreateNetworkACLCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.ImportNetworkACLCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.ListNetworkACLListsCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.ListNetworkACLsCmd;
|
||||
import org.apache.cloudstack.api.command.user.network.MoveNetworkAclItemCmd;
|
||||
|
|
@ -98,4 +99,6 @@ public interface NetworkACLService {
|
|||
NetworkACLItem moveNetworkAclRuleToNewPosition(MoveNetworkAclItemCmd moveNetworkAclItemCmd);
|
||||
|
||||
NetworkACLItem moveRuleToTheTopInACLList(NetworkACLItem ruleBeingMoved);
|
||||
|
||||
List<NetworkACLItem> importNetworkACLRules(ImportNetworkACLCmd cmd) throws ResourceUnavailableException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,4 +84,6 @@ public interface VpcOffering extends InternalIdentity, Identity {
|
|||
NetworkOffering.RoutingMode getRoutingMode();
|
||||
|
||||
Boolean isSpecifyAsNumber();
|
||||
|
||||
boolean isConserveMode();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package com.cloud.network.vpc;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.command.admin.vpc.CloneVPCOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vpc.CreateVPCOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vpc.UpdateVPCOfferingCmd;
|
||||
import org.apache.cloudstack.api.command.user.vpc.ListVPCOfferingsCmd;
|
||||
|
|
@ -34,12 +35,14 @@ public interface VpcProvisioningService {
|
|||
|
||||
VpcOffering createVpcOffering(CreateVPCOfferingCmd cmd);
|
||||
|
||||
VpcOffering cloneVPCOffering(CloneVPCOfferingCmd cmd);
|
||||
|
||||
VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices,
|
||||
Map<String, List<String>> serviceProviders,
|
||||
Map serviceCapabilitystList, NetUtils.InternetProtocol internetProtocol,
|
||||
Long serviceOfferingId, String externalProvider, NetworkOffering.NetworkMode networkMode,
|
||||
List<Long> domainIds, List<Long> zoneIds, VpcOffering.State state,
|
||||
NetworkOffering.RoutingMode routingMode, boolean specifyAsNumber);
|
||||
NetworkOffering.RoutingMode routingMode, boolean specifyAsNumber, boolean conserveMode);
|
||||
|
||||
|
||||
Pair<List<? extends VpcOffering>,Integer> listVpcOfferings(ListVPCOfferingsCmd cmd);
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
// under the License.
|
||||
package com.cloud.server;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
|
||||
|
||||
// FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
|
||||
|
|
@ -70,7 +70,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
|
|||
GuestOs(false, true),
|
||||
NetworkOffering(false, true),
|
||||
VpcOffering(true, false),
|
||||
Domain(false, false, true),
|
||||
Domain(true, false, true),
|
||||
ObjectStore(false, false, true);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ public interface VolumeApiService {
|
|||
Boolean.class,
|
||||
"use.https.to.upload",
|
||||
"true",
|
||||
"Determines the protocol (HTTPS or HTTP) ACS will use to generate links to upload ISOs, volumes, and templates. When set as 'true', ACS will use protocol HTTPS, otherwise, it will use protocol HTTP. Default value is 'true'.",
|
||||
"Controls whether upload links for ISOs, volumes, and templates use HTTPS (true, default) or HTTP (false). After changing this setting, the Secondary Storage VM (SSVM) must be recreated",
|
||||
true,
|
||||
ConfigKey.Scope.StoragePool);
|
||||
ConfigKey.Scope.Zone);
|
||||
|
||||
/**
|
||||
* Creates the database object for a volume based on the given criteria
|
||||
|
|
|
|||
|
|
@ -21,12 +21,13 @@ import java.util.Map;
|
|||
|
||||
import com.cloud.utils.Pair;
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.acl.RolePermissionEntity;
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.acl.apikeypair.ApiKeyPair;
|
||||
import org.apache.cloudstack.acl.apikeypair.ApiKeyPairPermission;
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.command.admin.account.CreateAccountCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.GetUserKeysCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.domain.Domain;
|
||||
|
|
@ -35,6 +36,14 @@ import com.cloud.network.vpc.VpcOffering;
|
|||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import org.apache.cloudstack.api.command.admin.user.DeleteUserKeysCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.GetUserKeysCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.ListUserKeyRulesCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.ListUserKeysCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeysCmd;
|
||||
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
|
||||
import org.apache.cloudstack.api.response.ApiKeyPairResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.auth.UserTwoFactorAuthenticator;
|
||||
import org.apache.cloudstack.backup.BackupOffering;
|
||||
|
||||
|
|
@ -59,7 +68,8 @@ public interface AccountService {
|
|||
|
||||
User getSystemUser();
|
||||
|
||||
User createUser(String userName, String password, String firstName, String lastName, String email, String timeZone, String accountName, Long domainId, String userUUID);
|
||||
User createUser(String userName, String password, String firstName, String lastName, String email, String timeZone,
|
||||
String accountName, Long domainId, String userUUID, boolean isPasswordChangeRequired);
|
||||
|
||||
User createUser(String userName, String password, String firstName, String lastName, String email, String timeZone, String accountName, Long domainId, String userUUID,
|
||||
User.Source source);
|
||||
|
|
@ -96,7 +106,7 @@ public interface AccountService {
|
|||
|
||||
void markUserRegistered(long userId);
|
||||
|
||||
public String[] createApiKeyAndSecretKey(RegisterUserKeyCmd cmd);
|
||||
ApiKeyPair createApiKeyAndSecretKey(RegisterUserKeysCmd cmd);
|
||||
|
||||
public String[] createApiKeyAndSecretKey(final long userId);
|
||||
|
||||
|
|
@ -124,7 +134,9 @@ public interface AccountService {
|
|||
|
||||
void validateAccountHasAccessToResource(Account account, AccessType accessType, Object resource);
|
||||
|
||||
Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly);
|
||||
void validateCallingUserHasAccessToDesiredUser(Long userId);
|
||||
|
||||
Long finalizeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly);
|
||||
|
||||
/**
|
||||
* returns the user account object for a given user id
|
||||
|
|
@ -133,9 +145,15 @@ public interface AccountService {
|
|||
*/
|
||||
UserAccount getUserAccountById(Long userId);
|
||||
|
||||
public Pair<Boolean, Map<String, String>> getKeys(GetUserKeysCmd cmd);
|
||||
Pair<Boolean, Map<String, String>> getKeys(GetUserKeysCmd cmd);
|
||||
|
||||
public Pair<Boolean, Map<String, String>> getKeys(Long userId);
|
||||
ListResponse<ApiKeyPairResponse> listKeys(ListUserKeysCmd cmd);
|
||||
|
||||
List<ApiKeyPairPermission> listKeyRules(ListUserKeyRulesCmd cmd);
|
||||
|
||||
void deleteApiKey(DeleteUserKeysCmd cmd);
|
||||
|
||||
void deleteApiKey(ApiKeyPair id);
|
||||
|
||||
/**
|
||||
* Lists user two-factor authentication provider plugins
|
||||
|
|
@ -150,4 +168,13 @@ public interface AccountService {
|
|||
*/
|
||||
UserTwoFactorAuthenticator getUserTwoFactorAuthenticationProvider(final Long domainId);
|
||||
|
||||
ApiKeyPair getLatestUserKeyPair(Long userId);
|
||||
|
||||
ApiKeyPair getKeyPairById(Long id);
|
||||
|
||||
ApiKeyPair getKeyPairByApiKey(String apiKey);
|
||||
|
||||
String getAccessingApiKey(BaseCmd cmd);
|
||||
|
||||
List<RolePermissionEntity> getAllKeypairPermissions(String apiKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,22 +14,8 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.user;
|
||||
|
||||
package org.apache.cloudstack.quota.activationrule.presetvariables;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class DomainTest {
|
||||
|
||||
@Test
|
||||
public void setPathTestAddFieldPathToCollection() {
|
||||
Domain variable = new Domain();
|
||||
variable.setPath("test path");
|
||||
Assert.assertTrue(variable.fieldNamesToIncludeInToString.contains("path"));
|
||||
}
|
||||
|
||||
public enum ApiKeyPairState {
|
||||
ENABLED, REMOVED, EXPIRED
|
||||
}
|
||||
|
|
@ -65,14 +65,6 @@ public interface User extends OwnedBy, InternalIdentity {
|
|||
|
||||
public void setState(Account.State state);
|
||||
|
||||
public String getApiKey();
|
||||
|
||||
public void setApiKey(String apiKey);
|
||||
|
||||
public String getSecretKey();
|
||||
|
||||
public void setSecretKey(String secretKey);
|
||||
|
||||
public String getTimezone();
|
||||
|
||||
public void setTimezone(String timezone);
|
||||
|
|
|
|||
|
|
@ -39,10 +39,6 @@ public interface UserAccount extends InternalIdentity {
|
|||
|
||||
String getState();
|
||||
|
||||
String getApiKey();
|
||||
|
||||
String getSecretKey();
|
||||
|
||||
Date getCreated();
|
||||
|
||||
Date getRemoved();
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ public interface VmDetailConstants {
|
|||
String CKS_NODE_TYPE = "node";
|
||||
String OFFERING = "offering";
|
||||
String TEMPLATE = "template";
|
||||
String AFFINITY_GROUP = "affinitygroup";
|
||||
|
||||
// VMware to KVM VM migrations specific
|
||||
String VMWARE_TO_KVM_PREFIX = "vmware-to-kvm";
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.cloud.exception.PermissionDeniedException;
|
|||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import org.apache.cloudstack.acl.apikeypair.ApiKeyPairPermission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -31,8 +32,8 @@ public interface APIChecker extends Adapter {
|
|||
// If true, apiChecker has checked the operation
|
||||
// If false, apiChecker is unable to handle the operation or not implemented
|
||||
// On exception, checkAccess failed don't allow
|
||||
boolean checkAccess(User user, String apiCommandName) throws PermissionDeniedException;
|
||||
boolean checkAccess(Account account, String apiCommandName) throws PermissionDeniedException;
|
||||
boolean checkAccess(User user, String apiCommandName, ApiKeyPairPermission... apiKeyPairPermissions) throws PermissionDeniedException;
|
||||
boolean checkAccess(Account account, String apiCommandName, ApiKeyPairPermission... apiKeyPairPermissions) throws PermissionDeniedException;
|
||||
/**
|
||||
* Verifies if the account has permission for the given list of APIs and returns only the allowed ones.
|
||||
*
|
||||
|
|
@ -43,4 +44,5 @@ public interface APIChecker extends Adapter {
|
|||
*/
|
||||
List<String> getApisAllowedToUser(Role role, User user, List<String> apiNames) throws PermissionDeniedException;
|
||||
boolean isEnabled();
|
||||
List<RolePermissionEntity> getImplicitRolePermissions(RoleType roleType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.apache.cloudstack.api.Identity;
|
|||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public interface RolePermissionEntity extends InternalIdentity, Identity {
|
||||
public enum Permission {
|
||||
enum Permission {
|
||||
ALLOW, DENY
|
||||
}
|
||||
Rule getRule();
|
||||
|
|
|
|||
|
|
@ -104,5 +104,26 @@ public interface RoleService {
|
|||
|
||||
List<RolePermission> findAllPermissionsBy(Long roleId);
|
||||
|
||||
List<RolePermissionEntity> findAllRolePermissionsEntityBy(Long roleId, boolean considerImplicitRules);
|
||||
|
||||
Permission getRolePermission(String permission);
|
||||
|
||||
int removeRolesIfNeeded(List<? extends Role> roles);
|
||||
|
||||
/**
|
||||
* Checks if the role of the caller account has compatible permissions of the specified role permissions.
|
||||
* For each permission of the {@param rolePermissionsToAccess}, the role of the caller needs to contain the same permission.
|
||||
*
|
||||
* @param rolePermissions the permissions of the caller role.
|
||||
* @param rolePermissionsToAccess the permissions for the role that the caller role wants to access.
|
||||
* @return True if the role can be accessed with the given permissions; false otherwise.
|
||||
*/
|
||||
boolean roleHasPermission(Map<String, RolePermissionEntity> rolePermissions, List<RolePermissionEntity> rolePermissionsToAccess);
|
||||
|
||||
/**
|
||||
* Given a list of role permissions, returns a {@link Map} containing the API name as the key and the {@link RolePermissionEntity} for the API as the value.
|
||||
*
|
||||
* @param rolePermissions Permissions for the role from role.
|
||||
*/
|
||||
Map<String, RolePermissionEntity> getRoleRulesAndPermissions(List<RolePermissionEntity> rolePermissions);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,16 +25,18 @@ import org.apache.commons.lang3.StringUtils;
|
|||
|
||||
public final class Rule {
|
||||
private final String rule;
|
||||
private final Pattern matchingPattern;
|
||||
private final static Pattern ALLOWED_PATTERN = Pattern.compile("^[a-zA-Z0-9*]+$");
|
||||
|
||||
public Rule(final String rule) {
|
||||
validate(rule);
|
||||
this.rule = rule;
|
||||
matchingPattern = Pattern.compile(rule.toLowerCase().replace("*", "(\\w*\\*?)+"));
|
||||
}
|
||||
|
||||
public boolean matches(final String commandName) {
|
||||
return StringUtils.isNotEmpty(commandName)
|
||||
&& commandName.toLowerCase().matches(rule.toLowerCase().replace("*", "\\w*"));
|
||||
return StringUtils.isNotEmpty(commandName) &&
|
||||
matchingPattern.matcher(commandName.toLowerCase()).matches();
|
||||
}
|
||||
|
||||
public String getRuleString() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.acl.apikeypair;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface ApiKeyPair extends ControlledEntity, InternalIdentity, Identity {
|
||||
Long getUserId();
|
||||
Date getStartDate();
|
||||
Date getEndDate();
|
||||
Date getCreated();
|
||||
String getDescription();
|
||||
String getApiKey();
|
||||
String getSecretKey();
|
||||
String getName();
|
||||
Date getRemoved();
|
||||
void setRemoved(Date date);
|
||||
void validateDate();
|
||||
boolean hasEndDatePassed();
|
||||
}
|
||||
|
|
@ -14,21 +14,10 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.acl.apikeypair;
|
||||
|
||||
package org.apache.cloudstack.quota.activationrule.presetvariables;
|
||||
import org.apache.cloudstack.acl.RolePermissionEntity;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class AccountTest {
|
||||
|
||||
@Test
|
||||
public void setRoleTestAddFieldRoleToCollection() {
|
||||
Account variable = new Account();
|
||||
variable.setRole(null);
|
||||
Assert.assertTrue(variable.fieldNamesToIncludeInToString.contains("role"));
|
||||
}
|
||||
public interface ApiKeyPairPermission extends RolePermissionEntity {
|
||||
long getApiKeyPairId();
|
||||
}
|
||||
|
|
@ -14,21 +14,14 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.acl.apikeypair;
|
||||
|
||||
package org.apache.cloudstack.quota.activationrule.presetvariables;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
public interface ApiKeyPairService {
|
||||
List<ApiKeyPairPermission> findAllPermissionsByKeyPairId(Long apiKeyPairId, Long roleId);
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class HostTest {
|
||||
ApiKeyPair findByApiKey(String apiKey);
|
||||
|
||||
@Test
|
||||
public void setTagsTestAddFieldTagsToCollection() {
|
||||
Host variable = new Host();
|
||||
variable.setTags(null);
|
||||
Assert.assertTrue(variable.fieldNamesToIncludeInToString.contains("tags"));
|
||||
}
|
||||
ApiKeyPair findById(Long id);
|
||||
}
|
||||
|
|
@ -66,5 +66,4 @@ public interface AffinityGroupService {
|
|||
|
||||
boolean isAffinityGroupAvailableInDomain(long affinityGroupId, long domainId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ import java.util.List;
|
|||
|
||||
public class AffinityProcessorBase extends AdapterBase implements AffinityGroupProcessor {
|
||||
|
||||
public static final String AFFINITY_TYPE_HOST = "host affinity";
|
||||
public static final String AFFINITY_TYPE_HOST_ANTI = "host anti-affinity";
|
||||
|
||||
protected String _type;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,18 +24,24 @@ import com.cloud.exception.InvalidParameterValueException;
|
|||
|
||||
public interface AlertService {
|
||||
public static class AlertType {
|
||||
private static Set<AlertType> defaultAlertTypes = new HashSet<AlertType>();
|
||||
private static final Set<AlertType> defaultAlertTypes = new HashSet<>();
|
||||
private final String name;
|
||||
private final short type;
|
||||
private final boolean repetitionAllowed;
|
||||
|
||||
private AlertType(short type, String name, boolean isDefault) {
|
||||
private AlertType(short type, String name, boolean isDefault, boolean repetitionAllowed) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.repetitionAllowed = repetitionAllowed;
|
||||
if (isDefault) {
|
||||
defaultAlertTypes.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
private AlertType(short type, String name, boolean isDefault) {
|
||||
this(type, name, isDefault, false);
|
||||
}
|
||||
|
||||
public static final AlertType ALERT_TYPE_MEMORY = new AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true);
|
||||
public static final AlertType ALERT_TYPE_CPU = new AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true);
|
||||
public static final AlertType ALERT_TYPE_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true);
|
||||
|
|
@ -45,36 +51,36 @@ public interface AlertService {
|
|||
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, "ALERT.NETWORK.IPV6SUBNET", true);
|
||||
public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true);
|
||||
public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", true);
|
||||
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true);
|
||||
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true);
|
||||
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true);
|
||||
public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true);
|
||||
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true, true);
|
||||
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true, true);
|
||||
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true, true);
|
||||
public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true, true);
|
||||
public static final AlertType ALERT_TYPE_ROUTING = new AlertType((short)11, "ALERT.NETWORK.ROUTING", true);
|
||||
public static final AlertType ALERT_TYPE_STORAGE_MISC = new AlertType((short)12, "ALERT.STORAGE.MISC", true);
|
||||
public static final AlertType ALERT_TYPE_STORAGE_MISC = new AlertType((short)12, "ALERT.STORAGE.MISC", true, true);
|
||||
public static final AlertType ALERT_TYPE_USAGE_SERVER = new AlertType((short)13, "ALERT.USAGE", true);
|
||||
public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new AlertType((short)14, "ALERT.MANAGEMENT", true);
|
||||
public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new AlertType((short)14, "ALERT.MANAGEMENT", true, true);
|
||||
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true);
|
||||
public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true);
|
||||
public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new AlertType((short)17, "ALERT.USERVM.MIGRATE", true);
|
||||
public static final AlertType ALERT_TYPE_VLAN = new AlertType((short)18, "ALERT.NETWORK.VLAN", true);
|
||||
public static final AlertType ALERT_TYPE_SSVM = new AlertType((short)19, "ALERT.SERVICE.SSVM", true);
|
||||
public static final AlertType ALERT_TYPE_SSVM = new AlertType((short)19, "ALERT.SERVICE.SSVM", true, true);
|
||||
public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new AlertType((short)20, "ALERT.USAGE.RESULT", true);
|
||||
public static final AlertType ALERT_TYPE_STORAGE_DELETE = new AlertType((short)21, "ALERT.STORAGE.DELETE", true);
|
||||
public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new AlertType((short)22, "ALERT.RESOURCE.COUNT", true);
|
||||
public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new AlertType((short)23, "ALERT.USAGE.SANITY", true);
|
||||
public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true);
|
||||
public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new AlertType((short)25, "ALERT.STORAGE.LOCAL", true);
|
||||
public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new AlertType((short)26, "ALERT.RESOURCE.EXCEED", true);
|
||||
public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new AlertType((short)26, "ALERT.RESOURCE.EXCEED", true, true);
|
||||
public static final AlertType ALERT_TYPE_SYNC = new AlertType((short)27, "ALERT.TYPE.SYNC", true);
|
||||
public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new AlertType((short)28, "ALERT.UPLOAD.FAILED", true);
|
||||
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true);
|
||||
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true);
|
||||
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true);
|
||||
public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new AlertType((short)28, "ALERT.UPLOAD.FAILED", true, true);
|
||||
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true, true);
|
||||
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true, true);
|
||||
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true, true);
|
||||
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
|
||||
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
|
||||
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
|
||||
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
|
||||
public static final AlertType ALERT_TYPE_VPN_GATEWAY_OBSOLETE_PARAMETERS = new AlertType((short)34, "ALERT.S2S.VPN.GATEWAY.OBSOLETE.PARAMETERS", true);
|
||||
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)33, "ALERT.VR.PUBLIC.IFACE.MTU", true);
|
||||
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)34, "ALERT.VR.PRIVATE.IFACE.MTU", true);
|
||||
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true, true);
|
||||
public static final AlertType ALERT_TYPE_VPN_GATEWAY_OBSOLETE_PARAMETERS = new AlertType((short)34, "ALERT.S2S.VPN.GATEWAY.OBSOLETE.PARAMETERS", true, true);
|
||||
public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_BACKUP_STORAGE, "ALERT.STORAGE.BACKUP", true);
|
||||
public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_OBJECT_STORAGE, "ALERT.STORAGE.OBJECT", true);
|
||||
|
||||
|
|
@ -86,6 +92,10 @@ public interface AlertService {
|
|||
return name;
|
||||
}
|
||||
|
||||
public boolean isRepetitionAllowed() {
|
||||
return repetitionAllowed;
|
||||
}
|
||||
|
||||
private static AlertType getAlertType(short type) {
|
||||
for (AlertType alertType : defaultAlertTypes) {
|
||||
if (alertType.getType() == type) {
|
||||
|
|
@ -109,7 +119,7 @@ public interface AlertService {
|
|||
if (defaultAlert != null && !defaultAlert.getName().equalsIgnoreCase(name)) {
|
||||
throw new InvalidParameterValueException("There is a default alert having type " + type + " and name " + defaultAlert.getName());
|
||||
} else {
|
||||
return new AlertType(type, name, false);
|
||||
return new AlertType(type, name, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,4 +50,6 @@ public @interface APICommand {
|
|||
RoleType[] authorized() default {};
|
||||
|
||||
Class<?>[] entityType() default {};
|
||||
|
||||
String httpMethod() default "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api;
|
|||
public class ApiConstants {
|
||||
public static final String ACCOUNT = "account";
|
||||
public static final String ACCOUNTS = "accounts";
|
||||
public static final String ACCOUNT_NAME = "accountname";
|
||||
public static final String ACCOUNT_TYPE = "accounttype";
|
||||
public static final String ACCOUNT_ID = "accountid";
|
||||
public static final String ACCOUNT_IDS = "accountids";
|
||||
|
|
@ -46,6 +47,7 @@ public class ApiConstants {
|
|||
public static final String AS_NUMBER_ID = "asnumberid";
|
||||
public static final String ASN_RANGE = "asnrange";
|
||||
public static final String ASN_RANGE_ID = "asnrangeid";
|
||||
public static final String API_KEY_FILTER = "apikeyfilter";
|
||||
public static final String ASYNC_BACKUP = "asyncbackup";
|
||||
public static final String AUTO_SELECT = "autoselect";
|
||||
public static final String USER_API_KEY = "userapikey";
|
||||
|
|
@ -282,6 +284,7 @@ public class ApiConstants {
|
|||
public static final String HOST = "host";
|
||||
public static final String HOST_CONTROL_STATE = "hostcontrolstate";
|
||||
public static final String HOSTS_MAP = "hostsmap";
|
||||
public static final String HTTP_REQUEST_TYPE = "httprequesttype";
|
||||
public static final String HYPERVISOR = "hypervisor";
|
||||
public static final String INLINE = "inline";
|
||||
public static final String INSTANCE = "instance";
|
||||
|
|
@ -355,6 +358,7 @@ public class ApiConstants {
|
|||
public static final String JOB_STATUS = "jobstatus";
|
||||
public static final String KEEPALIVE_ENABLED = "keepaliveenabled";
|
||||
public static final String KERNEL_VERSION = "kernelversion";
|
||||
public static final String KEYPAIR_ID = "keypairid";
|
||||
public static final String KEY = "key";
|
||||
public static final String LABEL = "label";
|
||||
public static final String LASTNAME = "lastname";
|
||||
|
|
@ -502,6 +506,7 @@ public class ApiConstants {
|
|||
public static final String RECONNECT = "reconnect";
|
||||
public static final String RECOVER = "recover";
|
||||
public static final String REPAIR = "repair";
|
||||
public static final String REPETITION_ALLOWED = "repetitionallowed";
|
||||
public static final String REQUIRES_HVM = "requireshvm";
|
||||
public static final String RESOURCES = "resources";
|
||||
public static final String RESOURCE_COUNT = "resourcecount";
|
||||
|
|
@ -519,9 +524,9 @@ public class ApiConstants {
|
|||
public static final String SCHEDULE = "schedule";
|
||||
public static final String SCHEDULE_ID = "scheduleid";
|
||||
public static final String SCOPE = "scope";
|
||||
public static final String USER_SECRET_KEY = "usersecretkey";
|
||||
public static final String SEARCH_BASE = "searchbase";
|
||||
public static final String SECONDARY_IP = "secondaryip";
|
||||
public static final String SECRET_KEY = "secretkey";
|
||||
public static final String SECURITY_GROUP_IDS = "securitygroupids";
|
||||
public static final String SECURITY_GROUP_NAMES = "securitygroupnames";
|
||||
public static final String SECURITY_GROUP_NAME = "securitygroupname";
|
||||
|
|
@ -540,6 +545,7 @@ public class ApiConstants {
|
|||
public static final String SHOW_RESOURCE_ICON = "showicon";
|
||||
public static final String SHOW_INACTIVE = "showinactive";
|
||||
public static final String SHOW_UNIQUE = "showunique";
|
||||
public static final String SHOW_PERMISSIONS = "showpermissions";
|
||||
public static final String SIGNATURE = "signature";
|
||||
public static final String SIGNATURE_VERSION = "signatureversion";
|
||||
public static final String SINCE = "since";
|
||||
|
|
@ -555,6 +561,7 @@ public class ApiConstants {
|
|||
public static final String USE_STORAGE_REPLICATION = "usestoragereplication";
|
||||
|
||||
public static final String SOURCE_CIDR_LIST = "sourcecidrlist";
|
||||
public static final String SOURCE_OFFERING_ID = "sourceofferingid";
|
||||
public static final String SOURCE_ZONE_ID = "sourcezoneid";
|
||||
public static final String SSL_VERIFICATION = "sslverification";
|
||||
public static final String START_ASN = "startasn";
|
||||
|
|
@ -623,7 +630,6 @@ public class ApiConstants {
|
|||
public static final String USERNAME = "username";
|
||||
public static final String USER_CONFIGURABLE = "userconfigurable";
|
||||
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
|
||||
public static final String USER_SECRET_KEY = "usersecretkey";
|
||||
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
|
||||
public static final String USE_VIRTUAL_ROUTER_IP_RESOLVER = "userouteripresolver";
|
||||
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";
|
||||
|
|
@ -765,6 +771,7 @@ public class ApiConstants {
|
|||
public static final String ROLE_TYPE = "roletype";
|
||||
public static final String ROLE_NAME = "rolename";
|
||||
public static final String PERMISSION = "permission";
|
||||
public static final String PERMISSIONS = "permissions";
|
||||
public static final String RULE = "rule";
|
||||
public static final String RULES = "rules";
|
||||
public static final String RULE_ID = "ruleid";
|
||||
|
|
@ -982,6 +989,7 @@ public class ApiConstants {
|
|||
public static final String REGION_ID = "regionid";
|
||||
public static final String VPC_OFF_ID = "vpcofferingid";
|
||||
public static final String VPC_OFF_NAME = "vpcofferingname";
|
||||
public static final String VPC_OFFERING_CONSERVE_MODE = "vpcofferingconservemode";
|
||||
public static final String NETWORK = "network";
|
||||
public static final String VPC_ID = "vpcid";
|
||||
public static final String VPC_NAME = "vpcname";
|
||||
|
|
@ -1028,7 +1036,7 @@ public class ApiConstants {
|
|||
public static final String NSX_PROVIDER_PORT = "nsxproviderport";
|
||||
public static final String NSX_CONTROLLER_ID = "nsxcontrollerid";
|
||||
public static final String S3_ACCESS_KEY = "accesskey";
|
||||
public static final String S3_SECRET_KEY = "secretkey";
|
||||
public static final String SECRET_KEY = "secretkey";
|
||||
public static final String S3_END_POINT = "endpoint";
|
||||
public static final String S3_BUCKET_NAME = "bucket";
|
||||
public static final String S3_SIGNER = "s3signer";
|
||||
|
|
@ -1168,6 +1176,7 @@ public class ApiConstants {
|
|||
public static final String OVM3_VIP = "ovm3vip";
|
||||
public static final String CLEAN_UP_DETAILS = "cleanupdetails";
|
||||
public static final String CLEAN_UP_EXTERNAL_DETAILS = "cleanupexternaldetails";
|
||||
public static final String CLEAN_UP_EXTRA_CONFIG = "cleanupextraconfig";
|
||||
public static final String CLEAN_UP_PARAMETERS = "cleanupparameters";
|
||||
public static final String VIRTUAL_SIZE = "virtualsize";
|
||||
public static final String NETSCALER_CONTROLCENTER_ID = "netscalercontrolcenterid";
|
||||
|
|
@ -1218,6 +1227,7 @@ public class ApiConstants {
|
|||
public static final String DOCKER_REGISTRY_EMAIL = "dockerregistryemail";
|
||||
public static final String ISO_NAME = "isoname";
|
||||
public static final String ISO_STATE = "isostate";
|
||||
public static final String ISO_URL = "isourl";
|
||||
public static final String SEMANTIC_VERSION = "semanticversion";
|
||||
public static final String KUBERNETES_VERSION_ID = "kubernetesversionid";
|
||||
public static final String KUBERNETES_VERSION_NAME = "kubernetesversionname";
|
||||
|
|
@ -1238,6 +1248,13 @@ public class ApiConstants {
|
|||
public static final String MAX_SIZE = "maxsize";
|
||||
public static final String NODE_TYPE_OFFERING_MAP = "nodeofferings";
|
||||
public static final String NODE_TYPE_TEMPLATE_MAP = "nodetemplates";
|
||||
public static final String NODE_TYPE_AFFINITY_GROUP_MAP = "nodeaffinitygroups";
|
||||
public static final String CONTROL_AFFINITY_GROUP_IDS = "controlaffinitygroupids";
|
||||
public static final String CONTROL_AFFINITY_GROUP_NAMES = "controlaffinitygroupnames";
|
||||
public static final String WORKER_AFFINITY_GROUP_IDS = "workeraffinitygroupids";
|
||||
public static final String WORKER_AFFINITY_GROUP_NAMES = "workeraffinitygroupnames";
|
||||
public static final String ETCD_AFFINITY_GROUP_IDS = "etcdaffinitygroupids";
|
||||
public static final String ETCD_AFFINITY_GROUP_NAMES = "etcdaffinitygroupnames";
|
||||
|
||||
public static final String BOOT_TYPE = "boottype";
|
||||
public static final String BOOT_MODE = "bootmode";
|
||||
|
|
@ -1259,6 +1276,7 @@ public class ApiConstants {
|
|||
public static final String PROVIDER_FOR_2FA = "providerfor2fa";
|
||||
public static final String ISSUER_FOR_2FA = "issuerfor2fa";
|
||||
public static final String MANDATE_2FA = "mandate2fa";
|
||||
public static final String PASSWORD_CHANGE_REQUIRED = "passwordchangerequired";
|
||||
public static final String SECRET_CODE = "secretcode";
|
||||
public static final String LOGIN = "login";
|
||||
public static final String LOGOUT = "logout";
|
||||
|
|
|
|||
|
|
@ -49,5 +49,7 @@ public interface ApiServerService {
|
|||
|
||||
boolean resetPassword(UserAccount userAccount, String token, String password);
|
||||
|
||||
String getDomainId(Map<String, Object[]> params);
|
||||
|
||||
boolean isPostRequestsAndTimestampsEnforced();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
|
|||
public static final String migrationSyncObject = "migration";
|
||||
public static final String snapshotHostSyncObject = "snapshothost";
|
||||
public static final String gslbSyncObject = "globalserverloadbalancer";
|
||||
public static final String user = "user";
|
||||
|
||||
private Object job;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
|
@ -35,6 +36,7 @@ import com.cloud.bgp.BGPService;
|
|||
import org.apache.cloudstack.acl.ProjectRoleService;
|
||||
import org.apache.cloudstack.acl.RoleService;
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.acl.apikeypair.ApiKeyPairService;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupService;
|
||||
import org.apache.cloudstack.alert.AlertService;
|
||||
import org.apache.cloudstack.annotation.AnnotationService;
|
||||
|
|
@ -220,6 +222,8 @@ public abstract class BaseCmd {
|
|||
@Inject
|
||||
public Ipv6Service ipv6Service;
|
||||
@Inject
|
||||
public ApiKeyPairService apiKeyPairService;
|
||||
@Inject
|
||||
public VnfTemplateManager vnfTemplateManager;
|
||||
@Inject
|
||||
public BucketApiService _bucketService;
|
||||
|
|
@ -498,4 +502,14 @@ public abstract class BaseCmd {
|
|||
}
|
||||
return details;
|
||||
}
|
||||
|
||||
public String getResourceUuid(String parameterName) {
|
||||
UUID resourceUuid = CallContext.current().getApiResourceUuid(parameterName);
|
||||
|
||||
if (resourceUuid != null) {
|
||||
return resourceUuid.toString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
|
|||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "The ID of the image file")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "The name of the image file")
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, length = 251, description = "The name of the image file")
|
||||
private String templateName;
|
||||
|
||||
@Parameter(name = ApiConstants.OS_TYPE_ID,
|
||||
|
|
@ -153,8 +153,8 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
|
|||
return (Map) (paramsCollection.toArray())[0];
|
||||
}
|
||||
|
||||
public boolean isCleanupDetails(){
|
||||
return cleanupDetails == null ? false : cleanupDetails.booleanValue();
|
||||
public boolean isCleanupDetails() {
|
||||
return cleanupDetails != null && cleanupDetails;
|
||||
}
|
||||
|
||||
public CPU.CPUArch getCPUArch() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import java.util.Set;
|
|||
|
||||
import org.apache.cloudstack.api.response.ConsoleSessionResponse;
|
||||
import org.apache.cloudstack.consoleproxy.ConsoleSession;
|
||||
import org.apache.cloudstack.acl.apikeypair.ApiKeyPair;
|
||||
import org.apache.cloudstack.acl.apikeypair.ApiKeyPairPermission;
|
||||
import org.apache.cloudstack.affinity.AffinityGroup;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||
|
|
@ -41,6 +43,7 @@ import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
|
|||
import org.apache.cloudstack.api.response.BackupOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.BackupRepositoryResponse;
|
||||
import org.apache.cloudstack.api.response.BackupScheduleResponse;
|
||||
import org.apache.cloudstack.api.response.BaseRolePermissionResponse;
|
||||
import org.apache.cloudstack.api.response.BucketResponse;
|
||||
import org.apache.cloudstack.api.response.CapacityResponse;
|
||||
import org.apache.cloudstack.api.response.ClusterResponse;
|
||||
|
|
@ -77,6 +80,7 @@ import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
|
|||
import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
|
||||
import org.apache.cloudstack.api.response.IpQuarantineResponse;
|
||||
import org.apache.cloudstack.api.response.IsolationMethodResponse;
|
||||
import org.apache.cloudstack.api.response.ApiKeyPairResponse;
|
||||
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
|
||||
import org.apache.cloudstack.api.response.LBStickinessResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
|
|
@ -587,4 +591,8 @@ public interface ResponseGenerator {
|
|||
GuiThemeResponse createGuiThemeResponse(GuiThemeJoin guiThemeJoin);
|
||||
|
||||
ConsoleSessionResponse createConsoleSessionResponse(ConsoleSession consoleSession, ResponseView responseView);
|
||||
|
||||
ApiKeyPairResponse createKeyPairResponse(ApiKeyPair keyPair);
|
||||
|
||||
ListResponse<BaseRolePermissionResponse> createKeypairPermissionsResponse(List<ApiKeyPairPermission> permissions);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public class CreateAccountCmd extends BaseCmd {
|
|||
@Override
|
||||
public void execute() {
|
||||
validateParams();
|
||||
CallContext.current().setEventDetails("Account Name: " + getUsername() + ", Domain Id:" + getDomainId());
|
||||
CallContext.current().setEventDetails("Account Name: " + getUsername() + ", Domain ID:" + getResourceUuid(ApiConstants.DOMAIN_ID));
|
||||
UserAccount userAccount =
|
||||
_accountService.createUserAccount(this);
|
||||
if (userAccount != null) {
|
||||
|
|
|
|||
|
|
@ -108,12 +108,20 @@ public class DisableAccountCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Disabling Account: " + getAccountName() + " in domain: " + getDomainId();
|
||||
String message = "Disabling Account ";
|
||||
|
||||
if (getId() != null) {
|
||||
message += "with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
} else {
|
||||
message += getAccountName() + " in Domain: " + getResourceUuid(ApiConstants.DOMAIN_ID);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
|
||||
CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getDomainId());
|
||||
CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getResourceUuid(ApiConstants.DOMAIN_ID));
|
||||
Account result = _regionService.disableAccount(this);
|
||||
if (result != null){
|
||||
AccountResponse response = _responseGenerator.createAccountResponse(ResponseView.Full, result);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class CreateRolePermissionCmd extends BaseRolePermissionCmd {
|
|||
if (role == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role id provided");
|
||||
}
|
||||
CallContext.current().setEventDetails("Role id: " + role.getId() + ", rule:" + getRule() + ", permission: " + getPermission() + ", description: " + getDescription());
|
||||
CallContext.current().setEventDetails("Role ID: " + role.getUuid() + ", rule:" + getRule() + ", permission: " + getPermission() + ", description: " + getDescription());
|
||||
final RolePermission rolePermission = roleService.createRolePermission(role, getRule(), getPermission(), getDescription());
|
||||
if (rolePermission == null) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create role permission");
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class DeleteRoleCmd extends BaseCmd {
|
|||
if (role == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find the role with provided id");
|
||||
}
|
||||
CallContext.current().setEventDetails("Role id: " + role.getId());
|
||||
CallContext.current().setEventDetails("Role ID: " + role.getUuid());
|
||||
boolean result = roleService.deleteRole(role);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
response.setSuccess(result);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class DeleteRolePermissionCmd extends BaseCmd {
|
|||
if (rolePermission == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role permission id provided");
|
||||
}
|
||||
CallContext.current().setEventDetails("Role permission id: " + rolePermission.getId());
|
||||
CallContext.current().setEventDetails("Role permission ID: " + rolePermission.getUuid());
|
||||
boolean result = roleService.deleteRolePermission(rolePermission);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
response.setSuccess(result);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class DisableRoleCmd extends BaseCmd {
|
|||
if (role == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find the role with provided id");
|
||||
}
|
||||
CallContext.current().setEventDetails("Role id: " + role.getId());
|
||||
CallContext.current().setEventDetails("Role ID: " + role.getUuid());
|
||||
boolean result = roleService.disableRole(role);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
response.setSuccess(result);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class EnableRoleCmd extends BaseCmd {
|
|||
if (role == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find the role with provided id");
|
||||
}
|
||||
CallContext.current().setEventDetails("Role id: " + role.getId());
|
||||
CallContext.current().setEventDetails("Role ID: " + role.getUuid());
|
||||
boolean result = roleService.enableRole(role);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
response.setSuccess(result);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class UpdateRolePermissionCmd extends BaseCmd {
|
|||
if (getRuleId() != null || getRulePermission() != null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");
|
||||
}
|
||||
CallContext.current().setEventDetails("Reordering permissions for role id: " + role.getId());
|
||||
CallContext.current().setEventDetails("Reordering permissions for role with ID: " + role.getUuid());
|
||||
final List<RolePermission> rolePermissionsOrder = new ArrayList<>();
|
||||
for (Long rolePermissionId : getRulePermissionOrder()) {
|
||||
final RolePermission rolePermission = roleService.findRolePermission(rolePermissionId);
|
||||
|
|
@ -129,7 +129,7 @@ public class UpdateRolePermissionCmd extends BaseCmd {
|
|||
if (rolePermission == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid rule id provided");
|
||||
}
|
||||
CallContext.current().setEventDetails("Updating permission for rule id: " + getRuleId() + " to: " + getRulePermission().toString());
|
||||
CallContext.current().setEventDetails("Updating permission for rule with ID: " + getResourceUuid(ApiConstants.RULE_ID) + " to: " + getRulePermission().toString());
|
||||
result = roleService.updateRolePermission(role, rolePermission, getRulePermission());
|
||||
}
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class CreateProjectRolePermissionCmd extends BaseRolePermissionCmd {
|
|||
if (projectRole == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid project role ID provided");
|
||||
}
|
||||
CallContext.current().setEventDetails("Project Role ID: " + projectRole.getId() + ", Rule:" + getRule() + ", Permission: " + getPermission() + ", Description: " + getDescription());
|
||||
CallContext.current().setEventDetails("Project Role ID: " + projectRole.getUuid() + ", Rule:" + getRule() + ", Permission: " + getPermission() + ", Description: " + getDescription());
|
||||
final ProjectRolePermission projectRolePermission = projRoleService.createProjectRolePermission(this);
|
||||
if (projectRolePermission == null) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create project role permission");
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class DeleteProjectRoleCmd extends BaseCmd {
|
|||
if (role == null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find project role with provided id");
|
||||
}
|
||||
CallContext.current().setEventDetails("Deleting Project Role with id: " + role.getId());
|
||||
CallContext.current().setEventDetails("Deleting Project Role with ID: " + role.getUuid());
|
||||
boolean result = projRoleService.deleteProjectRole(role, getProjectId());
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
response.setSuccess(result);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class DeleteProjectRolePermissionCmd extends BaseCmd {
|
|||
if (rolePermission == null || rolePermission.getProjectId() != getProjectId()) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role permission id provided for the project");
|
||||
}
|
||||
CallContext.current().setEventDetails("Deleting Project Role permission with id: " + rolePermission.getId());
|
||||
CallContext.current().setEventDetails("Deleting Project Role permission with ID: " + rolePermission.getUuid());
|
||||
boolean result = projRoleService.deleteProjectRolePermission(rolePermission);
|
||||
SuccessResponse response = new SuccessResponse();
|
||||
response.setSuccess(result);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class UpdateProjectRolePermissionCmd extends BaseCmd {
|
|||
if (getProjectRuleId() != null || getProjectRolePermission() != null) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");
|
||||
}
|
||||
CallContext.current().setEventDetails("Reordering permissions for role id: " + projectRole.getId());
|
||||
CallContext.current().setEventDetails("Reordering permissions for role with ID: " + projectRole.getUuid());
|
||||
result = updateProjectRolePermissionOrder(projectRole);
|
||||
|
||||
} else if (getProjectRuleId() != null || getProjectRolePermission() != null ) {
|
||||
|
|
@ -123,7 +123,7 @@ public class UpdateProjectRolePermissionCmd extends BaseCmd {
|
|||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");
|
||||
}
|
||||
ProjectRolePermission rolePermission = getValidProjectRolePermission();
|
||||
CallContext.current().setEventDetails("Updating project role permission for rule id: " + getProjectRuleId() + " to: " + getProjectRolePermission().toString());
|
||||
CallContext.current().setEventDetails("Updating project role permission for rule ID: " + getProjectRuleId() + " to: " + getProjectRolePermission().toString());
|
||||
result = projRoleService.updateProjectRolePermission(projectId, projectRole, rolePermission, getProjectRolePermission());
|
||||
}
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Counter ID: " + getEntityId());
|
||||
CallContext.current().setEventDetails("Counter ID: " + getEntityUuid());
|
||||
Counter ctr = _autoScaleService.getCounter(getEntityId());
|
||||
CounterResponse response = _responseGenerator.createCounterResponse(ctr);
|
||||
response.setResponseName(getCommandName());
|
||||
|
|
|
|||
|
|
@ -91,6 +91,6 @@ public class DeleteCounterCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting a counter.";
|
||||
return "Deleting auto scaling counter with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,166 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package org.apache.cloudstack.api.command.admin.backup;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.command.offering.DomainAndZoneIdResolver;
|
||||
import org.apache.cloudstack.api.response.BackupOfferingResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.cloudstack.backup.BackupManager;
|
||||
import org.apache.cloudstack.backup.BackupOffering;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
@APICommand(name = "cloneBackupOffering",
|
||||
description = "Clones a backup offering from an existing offering",
|
||||
responseObject = BackupOfferingResponse.class, since = "4.23.0",
|
||||
authorized = {RoleType.Admin})
|
||||
public class CloneBackupOfferingCmd extends BaseAsyncCmd implements DomainAndZoneIdResolver {
|
||||
|
||||
@Inject
|
||||
protected BackupManager backupManager;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.SOURCE_OFFERING_ID, type = BaseCmd.CommandType.UUID, entityType = BackupOfferingResponse.class,
|
||||
required = true, description = "The ID of the source backup offering to clone from")
|
||||
private Long sourceOfferingId;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = BaseCmd.CommandType.STRING, required = true,
|
||||
description = "The name of the cloned offering")
|
||||
private String name;
|
||||
|
||||
@Parameter(name = ApiConstants.DESCRIPTION, type = BaseCmd.CommandType.STRING, required = false,
|
||||
description = "The description of the cloned offering")
|
||||
private String description;
|
||||
|
||||
@Parameter(name = ApiConstants.EXTERNAL_ID, type = BaseCmd.CommandType.STRING, required = false,
|
||||
description = "The backup offering ID (from backup provider side)")
|
||||
private String externalId;
|
||||
|
||||
@Parameter(name = ApiConstants.ZONE_ID, type = BaseCmd.CommandType.UUID, entityType = ZoneResponse.class,
|
||||
description = "The zone ID", required = false)
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name = ApiConstants.DOMAIN_ID,
|
||||
type = CommandType.STRING,
|
||||
description = "the ID of the containing domain(s) as comma separated string, public for public offerings",
|
||||
length = 4096)
|
||||
private String domainIds;
|
||||
|
||||
@Parameter(name = ApiConstants.ALLOW_USER_DRIVEN_BACKUPS, type = BaseCmd.CommandType.BOOLEAN,
|
||||
description = "Whether users are allowed to create adhoc backups and backup schedules", required = false)
|
||||
private Boolean userDrivenBackups;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getSourceOfferingId() {
|
||||
return sourceOfferingId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getExternalId() {
|
||||
return externalId;
|
||||
}
|
||||
|
||||
public Long getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public Boolean getUserDrivenBackups() {
|
||||
return userDrivenBackups;
|
||||
}
|
||||
|
||||
public List<Long> getDomainIds() {
|
||||
if (domainIds != null && !domainIds.isEmpty()) {
|
||||
return Arrays.asList(Arrays.stream(domainIds.split(",")).map(domainId -> Long.parseLong(domainId.trim())).toArray(Long[]::new));
|
||||
}
|
||||
LongFunction<List<Long>> defaultDomainsProvider = null;
|
||||
if (backupManager != null) {
|
||||
defaultDomainsProvider = backupManager::getBackupOfferingDomains;
|
||||
}
|
||||
return resolveDomainIds(domainIds, sourceOfferingId, defaultDomainsProvider, "backup offering");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
|
||||
try {
|
||||
BackupOffering policy = backupManager.cloneBackupOffering(this);
|
||||
if (policy == null) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to clone backup offering");
|
||||
}
|
||||
BackupOfferingResponse response = _responseGenerator.createBackupOfferingResponse(policy);
|
||||
response.setResponseName(getCommandName());
|
||||
setResponseObject(response);
|
||||
} catch (InvalidParameterValueException e) {
|
||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.getMessage());
|
||||
} catch (CloudRuntimeException e) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return CallContext.current().getCallingAccount().getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_VM_BACKUP_OFFERING_CLONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Cloning backup offering: " + name + " from source offering: " + (sourceOfferingId == null ? "" : sourceOfferingId.toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ import java.util.Set;
|
|||
public class ImportBackupOfferingCmd extends BaseAsyncCmd {
|
||||
|
||||
@Inject
|
||||
private BackupManager backupManager;
|
||||
protected BackupManager backupManager;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
|
|
@ -86,7 +86,8 @@ public class ImportBackupOfferingCmd extends BaseAsyncCmd {
|
|||
type = CommandType.LIST,
|
||||
collectionType = CommandType.UUID,
|
||||
entityType = DomainResponse.class,
|
||||
description = "the ID of the containing domain(s), null for public offerings")
|
||||
description = "the ID of the containing domain(s), null for public offerings",
|
||||
since = "4.23.0")
|
||||
private List<Long> domainIds;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -156,6 +157,6 @@ public class ImportBackupOfferingCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Importing backup offering: " + name + " (external ID: " + externalId + ") on zone ID " + zoneId ;
|
||||
return "Importing backup offering: " + name + " (external ID: " + externalId + ") on zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID) ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,6 +149,6 @@ public class IssueCertificateCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "issuing certificate for domain(s)=" + domains + ", ip(s)=" + addresses;
|
||||
return "Issuing certificate for domain(s)=" + domains + ", ip(s)=" + addresses;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public class ProvisionCertificateCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Provisioning certificate for host id=" + hostId + " using provider=" + provider;
|
||||
return "Provisioning certificate for host with ID: " + getResourceUuid(ApiConstants.HOST_ID) + " using provider: " + provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -142,6 +142,6 @@ public class ExecuteClusterDrsPlanCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return String.format("Executing DRS plan for cluster: %d", getId());
|
||||
return "Executing DRS plan for cluster with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ public class GetDiagnosticsDataCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Getting diagnostics data files from System VM: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
|
||||
return "Getting diagnostics data files from System Instance with ID: " + getResourceUuid(ApiConstants.TARGET_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public class RunDiagnosticsCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Executing diagnostics on System VM: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
|
||||
return "Executing diagnostics on System Instance with ID: " + getResourceUuid(ApiConstants.TARGET_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class CreateDomainCmd extends BaseCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Domain Name: " + getDomainName() + ((getParentDomainId() != null) ? ", Parent DomainId :" + getParentDomainId() : ""));
|
||||
CallContext.current().setEventDetails("Domain Name: " + getDomainName() + ((getParentDomainId() != null) ? ", Parent Domain ID:" + getResourceUuid(ApiConstants.PARENT_DOMAIN_ID) : ""));
|
||||
Domain domain = _domainService.createDomain(getDomainName(), getParentDomainId(), getNetworkDomain(), getDomainUUID());
|
||||
if (domain != null) {
|
||||
DomainResponse response = _responseGenerator.createDomainResponse(domain);
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting domain: " + getId();
|
||||
return "Deleting domain with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Domain Id: " + getId());
|
||||
CallContext.current().setEventDetails("Domain ID: " + getResourceUuid(ApiConstants.ID));
|
||||
boolean result = _regionService.deleteDomain(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiConstants.DomainDetails;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ResponseObject.ResponseView;
|
||||
import org.apache.cloudstack.api.command.user.UserCmd;
|
||||
|
|
@ -39,7 +39,7 @@ import com.cloud.server.ResourceTag;
|
|||
|
||||
@APICommand(name = "listDomains", description = "Lists domains and provides detailed information for listed domains", responseObject = DomainResponse.class, responseView = ResponseView.Restricted, entityType = {Domain.class},
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class ListDomainsCmd extends BaseListCmd implements UserCmd {
|
||||
public class ListDomainsCmd extends BaseListTaggedResourcesCmd implements UserCmd {
|
||||
|
||||
private static final String s_name = "listdomainsresponse";
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class UpdateDomainCmd extends BaseCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Domain Id: " + getId());
|
||||
CallContext.current().setEventDetails("Domain ID: " + getResourceUuid(ApiConstants.ID));
|
||||
Domain domain = _regionService.updateDomain(this);
|
||||
|
||||
if (domain != null) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class DiscoverGpuDevicesCmd extends BaseListCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Discovering GPU Devices on host id: " + getId());
|
||||
CallContext.current().setEventDetails("Discovering GPU Devices on host with ID: " + getResourceUuid(ApiConstants.ID));
|
||||
ListResponse<GpuDeviceResponse> response = gpuService.discoverGpuDevices(this);
|
||||
response.setResponseName(getCommandName());
|
||||
setResponseObject(response);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public class AddGuestOsCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Guest OS Id: " + getEntityId());
|
||||
CallContext.current().setEventDetails("Guest OS ID: " + getEntityUuid());
|
||||
GuestOS guestOs = _mgr.getAddedGuestOs(getEntityId());
|
||||
if (guestOs != null) {
|
||||
GuestOSResponse response = _responseGenerator.createGuestOSResponse(guestOs);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class RemoveGuestOsCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Guest OS Id: " + id);
|
||||
CallContext.current().setEventDetails("Guest OS ID: " + getResourceUuid(ApiConstants.ID));
|
||||
boolean result = _mgr.removeGuestOs(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
|
@ -74,7 +74,7 @@ public class RemoveGuestOsCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Removing Guest OS: " + getId();
|
||||
return "Removing Guest OS with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class RemoveGuestOsMappingCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Guest OS Mapping Id: " + id);
|
||||
CallContext.current().setEventDetails("Guest OS Mapping ID: " + getResourceUuid(ApiConstants.ID));
|
||||
boolean result = _mgr.removeGuestOsMapping(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
|
@ -74,7 +74,7 @@ public class RemoveGuestOsMappingCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Removing Guest OS Mapping: " + getId();
|
||||
return "Removing Guest OS Mapping with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class UpdateGuestOsCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Updating guest OS: " + getId();
|
||||
return "Updating guest OS with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class UpdateGuestOsMappingCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Updating Guest OS Mapping: " + getId();
|
||||
return "Updating Guest OS with ID: " + getResourceUuid(ApiConstants.ID) + " mapping.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public final class ConfigureHAForHostCmd extends BaseAsyncCmd {
|
|||
if (!result) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure HA provider for the host");
|
||||
}
|
||||
CallContext.current().setEventDetails("Host Id:" + host.getId() + " HA configured with provider: " + getHaProvider());
|
||||
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " HA configured with provider: " + getHaProvider());
|
||||
CallContext.current().putContextParameter(Host.class, host.getUuid());
|
||||
|
||||
setupResponse(result, host.getUuid());
|
||||
|
|
@ -115,6 +115,6 @@ public final class ConfigureHAForHostCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Configure HA for host: " + getHostId();
|
||||
return "Configuring HA for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public final class DisableHAForClusterCmd extends BaseAsyncCmd {
|
|||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find cluster by ID: " + getClusterId());
|
||||
}
|
||||
final boolean result = haConfigManager.disableHA(cluster);
|
||||
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " HA enabled: false");
|
||||
CallContext.current().setEventDetails("Cluster ID:" + cluster.getUuid() + " HA enabled: false");
|
||||
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
|
||||
|
||||
setupResponse(result);
|
||||
|
|
@ -102,7 +102,7 @@ public final class DisableHAForClusterCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Disable HA for cluster: " + getClusterId();
|
||||
return "Disabling HA for cluster with ID: " + getResourceUuid(ApiConstants.CLUSTER_ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public final class DisableHAForHostCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
final boolean result = haConfigManager.disableHA(host.getId(), HAResource.ResourceType.Host);
|
||||
CallContext.current().setEventDetails("Host Id:" + host.getId() + " HA enabled: false");
|
||||
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " HA enabled: false");
|
||||
CallContext.current().putContextParameter(Host.class, host.getUuid());
|
||||
|
||||
setupResponse(result, host.getUuid());
|
||||
|
|
@ -104,6 +104,6 @@ public final class DisableHAForHostCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Disable HA for host: " + getHostId();
|
||||
return "Disabling HA for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public final class DisableHAForZoneCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
final boolean result = haConfigManager.disableHA(dataCenter);
|
||||
CallContext.current().setEventDetails("Zone Id:" + dataCenter.getId() + " HA enabled: false");
|
||||
CallContext.current().setEventDetails("Zone ID:" + dataCenter.getUuid() + " HA enabled: false");
|
||||
CallContext.current().putContextParameter(DataCenter.class, dataCenter.getUuid());
|
||||
|
||||
setupResponse(result);
|
||||
|
|
@ -103,7 +103,7 @@ public final class DisableHAForZoneCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Disable HA for zone: " + getZoneId();
|
||||
return "Disabling HA for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public final class EnableHAForClusterCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
final boolean result = haConfigManager.enableHA(cluster);
|
||||
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " HA enabled: true");
|
||||
CallContext.current().setEventDetails("Cluster ID:" + cluster.getUuid() + " HA enabled: true");
|
||||
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
|
||||
|
||||
setupResponse(result);
|
||||
|
|
@ -103,6 +103,6 @@ public final class EnableHAForClusterCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Enable HA for cluster: " + getClusterId();
|
||||
return "Enabling HA for cluster with ID: " + getResourceUuid(ApiConstants.CLUSTER_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public final class EnableHAForHostCmd extends BaseAsyncCmd {
|
|||
}
|
||||
final boolean result = haConfigManager.enableHA(host.getId(), HAResource.ResourceType.Host);
|
||||
|
||||
CallContext.current().setEventDetails("Host Id:" + host.getId() + " HA enabled: true");
|
||||
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " HA enabled: true");
|
||||
CallContext.current().putContextParameter(Host.class, host.getUuid());
|
||||
|
||||
setupResponse(result, host.getUuid());
|
||||
|
|
@ -104,6 +104,6 @@ public final class EnableHAForHostCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Enable HA for host: " + getHostId();
|
||||
return "Enabling HA for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public final class EnableHAForZoneCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
final boolean result = haConfigManager.enableHA(dataCenter);
|
||||
CallContext.current().setEventDetails("Zone Id:" + dataCenter.getId() + " HA enabled: true");
|
||||
CallContext.current().setEventDetails("Zone ID:" + dataCenter.getUuid() + " HA enabled: true");
|
||||
CallContext.current().putContextParameter(DataCenter.class, dataCenter.getUuid());
|
||||
|
||||
setupResponse(result);
|
||||
|
|
@ -103,7 +103,7 @@ public final class EnableHAForZoneCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Enable HA for zone: " + getZoneId();
|
||||
return "Enabling HA for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ public class AddHostCmd extends BaseCmd {
|
|||
@Parameter(name = ApiConstants.POD_ID, type = CommandType.UUID, entityType = PodResponse.class, required = true, description = "The Pod ID for the host")
|
||||
private Long podId;
|
||||
|
||||
@Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "The host URL")
|
||||
@Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "The host URL, optionally add ssh port (format: 'host:port') for KVM hosts," +
|
||||
" otherwise falls back to the port defined at the config 'kvm.host.discovery.ssh.port'")
|
||||
private String url;
|
||||
|
||||
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true, description = "The Zone ID for the host")
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ import org.apache.cloudstack.api.response.ZoneResponse;
|
|||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.storage.ImageStore;
|
||||
import com.cloud.user.Account;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@APICommand(name = "addSecondaryStorage", description = "Adds secondary storage.", responseObject = ImageStoreResponse.class,
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
|
|
@ -44,6 +49,9 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "The Zone ID for the secondary storage")
|
||||
protected Long zoneId;
|
||||
|
||||
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "Details in key/value pairs using format details[i].keyname=keyvalue. Example: details[0].copytemplatesfromothersecondarystorages=true")
|
||||
protected Map details;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -56,6 +64,20 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
return zoneId;
|
||||
}
|
||||
|
||||
public Map<String, String> getDetails() {
|
||||
Map<String, String> detailsMap = new HashMap<>();
|
||||
if (MapUtils.isNotEmpty(details)) {
|
||||
Collection<?> props = details.values();
|
||||
for (Object prop : props) {
|
||||
HashMap<String, String> detail = (HashMap<String, String>) prop;
|
||||
for (Map.Entry<String, String> entry: detail.entrySet()) {
|
||||
detailsMap.put(entry.getKey(),entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return detailsMap;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -68,7 +90,7 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
@Override
|
||||
public void execute(){
|
||||
try{
|
||||
ImageStore result = _storageService.discoverImageStore(null, getUrl(), "NFS", getZoneId(), null);
|
||||
ImageStore result = _storageService.discoverImageStore(null, getUrl(), "NFS", getZoneId(), getDetails());
|
||||
ImageStoreResponse storeResponse = null;
|
||||
if (result != null ) {
|
||||
storeResponse = _responseGenerator.createImageStoreResponse(result);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class CancelHostAsDegradedCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "declaring host: " + getId() + " as Degraded";
|
||||
return "Removing host with ID: " + getResourceUuid(ApiConstants.ID) + " from Degraded state.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class CancelHostMaintenanceCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Canceling maintenance for host: " + getId();
|
||||
return "Canceling maintenance for host with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class DeclareHostAsDegradedCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "declaring host: " + getId() + " as Degraded";
|
||||
return "Declaring host with ID: " + getResourceUuid(ApiConstants.ID) + " as Degraded.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -118,6 +118,9 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
since = "4.21.0")
|
||||
private String storageAccessGroup;
|
||||
|
||||
@Parameter(name = ApiConstants.VERSION, type = CommandType.STRING, description = "the host version", since = "4.20.3")
|
||||
private String version;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -222,6 +225,10 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
this.storageAccessGroup = storageAccessGroup;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class PrepareForHostMaintenanceCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "preparing host: " + getId() + " for maintenance";
|
||||
return "Preparing host with ID: " + getResourceUuid(ApiConstants.ID) + " for maintenance.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class ReconnectHostCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "reconnecting host: " + getId();
|
||||
return "Reconnecting host with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class ReleaseHostReservationCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "releasing reservation for host: " + getId();
|
||||
return "Releasing reservation from host with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -84,12 +84,12 @@ public class ConfigureInternalLoadBalancerElementCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "configuring internal load balancer element: " + id;
|
||||
return "Configuring internal load balancer element with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
CallContext.current().setEventDetails("Internal load balancer element: " + id);
|
||||
CallContext.current().setEventDetails("Internal load balancer element: " + getResourceUuid(ApiConstants.ID));
|
||||
InternalLoadBalancerElementService service = _networkService.getInternalLoadBalancerElementById(id);
|
||||
VirtualRouterProvider result = service.configureInternalLoadBalancerElement(getId(), getEnabled());
|
||||
if (result != null) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class CreateInternalLoadBalancerElementCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
CallContext.current().setEventDetails("Virtual router element Id: " + getEntityId());
|
||||
CallContext.current().setEventDetails("Virtual router element ID: " + getEntityUuid());
|
||||
InternalLoadBalancerElementService service = _networkService.getInternalLoadBalancerElementByNetworkServiceProviderId(getNspId());
|
||||
VirtualRouterProvider result = service.getInternalLoadBalancerElement(getEntityId());
|
||||
if (result != null) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class StartInternalLBVMCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "starting Internal LB Instance: " + getId();
|
||||
return "Starting internal LB Instance with ID: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -103,7 +103,7 @@ public class StartInternalLBVMCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
CallContext.current().setEventDetails("Internal LB Instance ID: " + getId());
|
||||
CallContext.current().setEventDetails("Internal LB Instance ID: " + getResourceUuid(ApiConstants.ID));
|
||||
VirtualRouter result = null;
|
||||
VirtualRouter router = _routerService.findRouter(getId());
|
||||
if (router == null || router.getRole() != Role.INTERNAL_LB_VM) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class StopInternalLBVMCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Stopping Internal LB Instance: " + getId();
|
||||
return "Stopping Internal LB Instance: " + getResourceUuid(ApiConstants.ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -105,7 +105,7 @@ public class StopInternalLBVMCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
|
||||
CallContext.current().setEventDetails("Internal LB Instance Id: " + getId());
|
||||
CallContext.current().setEventDetails("Internal LB Instance ID: " + getResourceUuid(ApiConstants.ID));
|
||||
VirtualRouter result = null;
|
||||
VirtualRouter vm = _routerService.findRouter(getId());
|
||||
if (vm == null || vm.getRole() != Role.INTERNAL_LB_VM) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ public class ListMgmtsCmd extends BaseListCmd {
|
|||
since = "4.20.1.0")
|
||||
private Boolean peers;
|
||||
|
||||
@Parameter(name = ApiConstants.VERSION, type = CommandType.STRING,
|
||||
description = "the version of the management server", since = "4.20.3")
|
||||
private String version;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -61,6 +65,10 @@ public class ListMgmtsCmd extends BaseListCmd {
|
|||
return BooleanUtils.toBooleanDefaultIfNull(peers, false);
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue