Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7b9fc0e
wip: dns provider framework
sudo87 Feb 4, 2026
b2d597c
add db schema, vo and dao classes
sudo87 Feb 10, 2026
6ef7f9b
add powerdns module in plugins
sudo87 Feb 11, 2026
9911c28
Changes done to AddDnsServer, ListDnsServer, DeleteDnsServer and Upda…
sudo87 Feb 12, 2026
df21318
1. Setup Dns zone schema
sudo87 Feb 13, 2026
f29b8be
following dns zone apis are integrated:
sudo87 Feb 15, 2026
9b77c37
Tested following flow:
sudo87 Feb 16, 2026
c5972ae
Add associate and disassociate zone to network APIs
sudo87 Feb 16, 2026
99f8c7d
following things are done:
sudo87 Feb 17, 2026
e011ce1
add missing license, cleanup, log std
sudo87 Feb 18, 2026
4a9f66d
following changes are done:
sudo87 Feb 19, 2026
c64cf81
include:
sudo87 Feb 20, 2026
4df11a4
normalize dns zone and record in svc layer, always use dotless data i…
sudo87 Feb 21, 2026
857436e
enable apis for all roles
sudo87 Feb 21, 2026
582b687
add ACL annotation, entitytype, minor cleanup
sudo87 Feb 21, 2026
add7763
acl related changes, fixes, mistakes
sudo87 Feb 25, 2026
1fe79bd
fixes related to acl, dao
sudo87 Feb 25, 2026
6ca9d5a
add views for dns_server and dns_zone
sudo87 Feb 26, 2026
1c1eef3
Add Listener for VM lifecycle to add dnsrecords for associated dns zone
sudo87 Mar 2, 2026
caf8533
1. implement event processing for vm start/stop/destroy, nic create/d…
sudo87 Mar 3, 2026
856158c
starting on ui work
sudo87 Mar 3, 2026
928db65
resolve merge conflict with main
sudo87 Mar 3, 2026
369bb16
fix lint issue
sudo87 Mar 3, 2026
0df50ce
fix list dnsservers api, ui screens for dns servers, generate events
sudo87 Mar 4, 2026
a9afbce
UI related work and fixes in updateDnsServer cmd
sudo87 Mar 10, 2026
6bcfbc6
resolve conflict with main
sudo87 Mar 13, 2026
c74a579
resolve build and licensefailure issue
sudo87 Mar 14, 2026
7f5e2a7
continue UI component work, fix minor issue with apis
sudo87 Mar 17, 2026
d8cca73
resolve conflict with main
sudo87 Mar 17, 2026
a1eca74
work on updateDnsServer ui screen, fixed acl issue for dns server and…
sudo87 Mar 18, 2026
981bb64
add associate and disassociate dns zone to network ui screens, networ…
sudo87 Mar 19, 2026
af7ce8e
fix addDnsRecord and deleteDnsRecord flow for automatic registration …
sudo87 Mar 20, 2026
bde9fd9
improve cleanup logic for DNS zone and server
sudo87 Mar 23, 2026
5682a5a
modify delete flow for dns zone and server, ask to key in name
sudo87 Mar 23, 2026
c6abed1
Following changes are part of this commit:
sudo87 Mar 25, 2026
f1dcd00
add unit tests
sudo87 Apr 1, 2026
f524bbe
resolve conflict with main
sudo87 Apr 1, 2026
9d4e141
unit tests
sudo87 Apr 1, 2026
8d10ae1
Following changes are done:
sudo87 Apr 6, 2026
3567819
fix automatic dns record registration based on vm and nic lifecycle
sudo87 Apr 9, 2026
883dc32
changes:
sudo87 Apr 10, 2026
3ae9834
fix normalizing dns record values for mx, srv and other type
sudo87 Apr 11, 2026
a036281
split cleanup of old dns urls and new record registration
sudo87 Apr 13, 2026
6466362
unit tests
sudo87 Apr 14, 2026
9d0884a
add marvin test for powerdns
sudo87 Apr 15, 2026
30566d1
merge main changes
sudo87 Apr 15, 2026
f96d4cd
trim trailing space
sudo87 Apr 15, 2026
2d14c26
rename credentials param in dns server vue files to apikey
sudo87 Apr 16, 2026
001a197
rename apikey to dnsapikey, refactor ui and add dig verification in i…
sudo87 Apr 17, 2026
172ac67
rename dnsrecordurl -> nicdnsname, DnsNicJoinView -> nicDnsJoinVo
sudo87 Apr 20, 2026
5f627aa
changes in this commit:
sudo87 Apr 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
modify delete flow for dns zone and server, ask to key in name
  • Loading branch information
sudo87 committed Mar 23, 2026
commit 5682a5a9972a44d23c11a78f68df2ef31c2d2281
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ public boolean deleteDnsZone(Long zoneId) {

boolean dbResult = Transaction.execute((TransactionCallback<Boolean>) status -> {
DnsZoneNetworkMapVO networkMapVO = dnsZoneNetworkMapDao.findByZoneId(zoneId);
DnsProvider provider = getProviderByType(server.getProviderType());
// Remove DNS records from nic_details if there are any
if (networkMapVO != null) {
// Remove DNS records from nic_details if there are any
try {
DnsProvider provider = getProviderByType(server.getProviderType());
List<DnsRecord> records = provider.listRecords(server, dnsZone);
if (CollectionUtils.isNotEmpty(records)) {
List<String> dnsRecordNames = records.stream().map(DnsRecord::getName).filter(Objects::nonNull)
Expand All @@ -324,19 +324,19 @@ public boolean deleteDnsZone(Long zoneId) {
} catch (Exception ex) {
logger.warn("Failed to fetch DNS records for dnsZone: {}, perform manual cleanup.", dnsZoneName, ex);
}
// Remove DNS zone from provider and cleanup DB
try {
DnsProvider provider = getProviderByType(server.getProviderType());
provider.deleteZone(server, dnsZone);
logger.debug("Deleted DNS zone: {} from provider", dnsZoneName);
} catch (DnsNotFoundException ex) {
logger.warn("DNS zone: {} is not present in the provider, proceeding with cleanup", dnsZoneName);
} catch (Exception ex) {
logger.error("Failed to delete DNS zone from provider", ex);
throw new CloudRuntimeException(String.format("Failed to delete DNS zone: %s.", dnsZoneName));
}
dnsZoneNetworkMapDao.removeNetworkMappingByZoneId(zoneId);
}

// Remove DNS zone from provider and cleanup DB
try {
provider.deleteZone(server, dnsZone);
logger.debug("Deleted DNS zone: {} from provider", dnsZoneName);
} catch (DnsNotFoundException ex) {
logger.warn("DNS zone: {} is not present in the provider, proceeding with cleanup", dnsZoneName);
} catch (Exception ex) {
logger.error("Failed to delete DNS zone from provider", ex);
throw new CloudRuntimeException(String.format("Failed to delete DNS zone: %s.", dnsZoneName));
}
return dnsZoneDao.remove(zoneId);
});

Expand Down
5 changes: 3 additions & 2 deletions ui/src/config/section/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,7 @@ export default {
message: 'message.action.delete.dns.server',
dataView: true,
popup: true,
component: shallowRef(defineAsyncComponent(() => import('@/views/network/dns/DeleteDnsServer.vue'))),
show: (record, store) => { return record.account === store.userInfo.account || isAdminOrDomainAdmin(store.userInfo.roletype) },
groupAction: false,
groupMap: (selection) => { return selection.map(x => { return { id: x } }) }
Expand Down Expand Up @@ -1615,9 +1616,9 @@ export default {
message: 'message.action.delete.dns.zone',
dataView: true,
popup: true,
groupAction: false,
component: shallowRef(defineAsyncComponent(() => import('@/views/network/dns/DeleteDnsZone.vue'))),
show: (record, store) => { return record.account === store.userInfo.account || isAdminOrDomainAdmin(store.userInfo.roletype) },
groupMap: (selection) => { return selection.map(x => { return { id: x } }) }
groupAction: false
}
]
}
Expand Down
187 changes: 187 additions & 0 deletions ui/src/views/network/dns/DeleteDnsServer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// 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.

<template>
<div class="form-layout" v-ctrl-enter="handleSubmit">
<a-spin :spinning="loading">
<div style="margin-bottom: 20px;">
<a-alert type="warning">
<template #message>
<div v-html="$t('message.action.delete.dns.server')"></div>
</template>
</a-alert>
</div>

<div style="margin-bottom: 20px; word-break: break-all;">
Please type <strong>{{ resource.name }}</strong> to confirm.
</div>

<div v-if="dnsZones && dnsZones.length > 0" style="margin-bottom: 20px;">
<a-alert type="error">
<template #message>
<div>
<strong>This action will impact {{ this.totalDnsZones }} DNS Zone(s):</strong>
<ul style="margin-top: 10px; margin-bottom: 0; padding-left: 20px;">
<li v-for="zone in dnsZones.slice(0, this.maxResults)" :key="zone.id">{{ zone.name }}</li>
</ul>
<div v-if="this.totalDnsZones > this.maxResults" style="margin-top: 5px; font-style: italic;">
...and {{ this.totalDnsZones - this.maxResults }} more
</div>
</div>
</template>
</a-alert>
</div>

<a-form
ref="formRef"
:model="form"
:rules="rules"
layout="vertical">

<a-form-item name="name" ref="name">
<a-input
v-model:value="form.name"
:placeholder="resource.name"
v-focus="true" />
</a-form-item>

<div class="action-button">
<a-button @click="closeAction">
{{ $t('label.cancel') }}
</a-button>
<a-button
type="primary"
danger
:disabled="form.name !== resource.name"
:loading="loading"
@click="handleSubmit">
{{ $t('label.delete') }}
</a-button>
</div>
</a-form>
</a-spin>
</div>
</template>

<script>
import { getAPI, postAPI } from '@/api'

export default {
name: 'DeleteDnsServer',
props: {
resource: {
type: Object,
required: true
}
},
data () {
return {
loading: false,
dnsZones: [],
form: {
name: ''
},
rules: {
name: [{ required: true, message: this.$t('message.error.required.input') }]
},
maxResults: 5,
totalDnsZones: 0
}
},
created () {
this.fetchDnsZones()
},
methods: {
async fetchDnsZones () {
this.loading = true
try {
const response = await getAPI('listDnsZones', { dnsserverid: this.resource.id, page: 1, pagesize: this.maxResults, filter: 'name' })
this.dnsZones = response?.listdnszonesresponse?.dnszone || []
this.totalDnsZones = response?.listdnszonesresponse?.count || 0
} catch (error) {
console.error('Failed to fetch DNS zones', error)
} finally {
this.loading = false
}
},
async handleSubmit () {
if (this.loading || this.form.name !== this.resource.name) return

this.loading = true

try {
const params = {
id: this.resource.id
}

const response = await postAPI('deleteDnsServer', params)
const jobId = response?.deletednsserverresponse?.jobid
if (jobId) {
this.$pollJob({
jobId: jobId,
title: this.$t('label.dns.delete.server'),
description: this.resource.name,
successMethod: () => {
this.$notification.success({
message: this.$t('label.dns.delete.server'),
description: `Successfully deleted DNS server ${this.resource.name}`
})
},
loadingMessage: `${this.$t('label.dns.delete.server')} ${this.$t('label.in.progress')}`,
catchMessage: this.$t('error.fetching.async.job.result')
})
}

if (this.$route.path !== '/dnsserver') {
this.$router.push({ path: '/dnsserver' })
} else {
this.$emit('refresh-data')
}
this.closeAction()
} catch (error) {
this.$notification.error({
message: this.$t('message.request.failed'),
description: error?.response?.headers['x-description'] || error.message,
duration: 0
})
} finally {
this.loading = false
}
},
closeAction () {
this.$emit('close-action')
}
}
}
</script>

<style lang="less" scoped>
.form-layout {
width: 80vw;
@media (min-width: 600px) {
width: 450px;
}
}

.action-button {
text-align: right;
margin-top: 20px;
}
.action-button button {
margin-left: 8px;
}
</style>
Loading
Loading